Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1612522rwd; Tue, 16 May 2023 21:33:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4bX3RBsQ4La72iH5umoh4ILM1Uwmn1WUxUbEN84wXfcSBdjSLmAQlUFsk4YSISrtIe2S+Y X-Received: by 2002:a05:6a20:4658:b0:ec:8f81:e9f7 with SMTP id eb24-20020a056a20465800b000ec8f81e9f7mr43251578pzb.16.1684298027828; Tue, 16 May 2023 21:33:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684298027; cv=none; d=google.com; s=arc-20160816; b=A3AcNSCxsyKZmEAjSruP6fiELVau45pgec5Vl4xAWQaLziHCbsCkQRAJn5BCWqAFGi XvjuXffI9hnwjBYMx8kWwHEgm3eyRwYGeYjtNivQmRcQ6LfLL3FdiAfNIgsdRYm+Lo8l zXHLDXK/eyuL/+/v6zlJjij3hYa0/6/WTXtvO59X9zXyMe/zkn0NF50DUmiXbYyvcOOr uiS3rLpIdNPwH+k3ezjxvyok6Z2euk9+O7PYC+DoHypPnMIaVGGC3jYY/Dr24sS+hRjJ /ju6E1QS/S4wZn7epKYZW3oOQSZR505i/t2RMHj0R2pZri0xfdsL5EY6fbgWuB1AU0IE SG0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=oiUn5dEHBhf+38HghSn0bjXjsqzW3OiA7bRXz6qMVI0=; b=KiVuOF0zC4JOzdaevJhZBJhzEXR3U+SmH8aR/wSv+uE9/BT6NaFlz24UndN/Kh2Xfg anaeKBkfgXMjt915wohi2LWGezkEgHzXrPdFIrWRSrFGrLuCnd8ZWo2vD6O2NUOrnQsW FmRA9TREosWvWLhB4NdejDjjgcKiFDcndE+IWlrZFnc5CeLLwHPhizqs0jurZYlmXe6z GcietD3z1yTe5bgLVJiwrg4+acrKQMRb0+TWJMHj+iSIzW2eVcGSeG/ymBk4JOrsjVu5 LWq8ZaAAhQXda4NU3IdGwvdEOp1LoRubNaY9QtZYtM+xISa7x6IL27fiU7LQIamKWBSj XBKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bs3-20020a632803000000b0052ca7192675si19684774pgb.729.2023.05.16.21.33.35; Tue, 16 May 2023 21:33:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229646AbjEQEDO (ORCPT + 99 others); Wed, 17 May 2023 00:03:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbjEQEDM (ORCPT ); Wed, 17 May 2023 00:03:12 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 84B6A3A9C for ; Tue, 16 May 2023 21:03:10 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id B2F4D180120CD7; Wed, 17 May 2023 12:03:00 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org, Li zeming Subject: [PATCH] sched: core: Simplify cpuset_cpumask_can_shrink() Date: Fri, 19 May 2023 04:34:16 +0800 Message-Id: <20230518203416.3323-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_24_48, RDNS_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove useless intermediate variable "ret" and its initialization. Directly return dl_cpuset_cpumask_can_shrink() result. Signed-off-by: Li zeming --- kernel/sched/core.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index a66960da3f5c..f3f2ece26291 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -9273,14 +9273,10 @@ void __init init_idle(struct task_struct *idle, int cpu) int cpuset_cpumask_can_shrink(const struct cpumask *cur, const struct cpumask *trial) { - int ret = 1; - if (cpumask_empty(cur)) - return ret; - - ret = dl_cpuset_cpumask_can_shrink(cur, trial); + return 1; - return ret; + return dl_cpuset_cpumask_can_shrink(cur, trial); } int task_can_attach(struct task_struct *p, -- 2.18.2