From patchwork Thu May 18 20:34:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li zeming X-Patchwork-Id: 95038 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp871094vqo; Tue, 16 May 2023 21:31:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4POiYu+xI0iPvGydWVetR+ch+KpxRcpFFzWe+T5JRM5LpBVLljFjHlpUZcDoWZgtJjvcpI X-Received: by 2002:a05:6a20:c701:b0:f3:1c69:7eeb with SMTP id hi1-20020a056a20c70100b000f31c697eebmr38790866pzb.17.1684297889516; Tue, 16 May 2023 21:31:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684297889; cv=none; d=google.com; s=arc-20160816; b=PSAYh9+KOObbyewqoP4+QhqSZo5q5oOB5lMaBCsBjl4KJNYiDuHuEJIr+M7IGBJddC 3BsmjpcrtQGUnbEoD+Nhj1sgzsdXHcpeIx49UZSumdZttYZ9RCLd04ZFlu7LnSwzSADp HppHGUxZEGOSMUrq6Ch6kI7/I6esakEvDQ18augv5kjCcxRynEFVJ1h6wZQ9aeI5Wyjl yysDU0XlaUoUZ3aKcKtN1Ap3F3peIlocPUFrGYrLVDiHyYHITC5vG9/BkHX+7D0EXUlo ySsjDQOupHr98YZFmghA/TF5tmVAoWpzq1+RTMFXFVxv3hiTp3jhkM9Zm/Yx+H4xUyMh Mw8Q== 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 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.31.16; Tue, 16 May 2023 21:31:29 -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 S229437AbjEQEDP (ORCPT + 99 others); Wed, 17 May 2023 00:03:15 -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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766114343739695274?= X-GMAIL-MSGID: =?utf-8?q?1766114343739695274?= Remove useless intermediate variable "ret" and its initialization. Directly return dl_cpuset_cpumask_can_shrink() result. Signed-off-by: Li zeming Reviewed-by: Valentin Schneider --- 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,