Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp950055imw; Tue, 5 Jul 2022 00:45:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vFNQ30PJClcRFhZK6qrmpWRFQp9Dp5wLXmwrCBy/9KaO+H2aXLoHJ0rhyznNN3y6j0y6Xa X-Received: by 2002:a05:6402:909:b0:435:a8b:5232 with SMTP id g9-20020a056402090900b004350a8b5232mr43153378edz.240.1657007157715; Tue, 05 Jul 2022 00:45:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657007157; cv=none; d=google.com; s=arc-20160816; b=yMUBMYvg79rlQEJjDoC6M6i2vqF5oHQ9YB4LV2tIc1atZT2jGwSY5KCyQthptvvDgz jnBAlvXL1L1N+ozaNts0jUikKqtHe6TdMwhRIz3HZNNBhw4LLkI/dMcsAU3SQ77MD/z6 z8ml178DOSQWBdrF9l8xiFKiDUI9euNq5ZHGIT1aYzs9a6+6KogSAZUbu9b3tbhgbMXt 6JXzuVdppkbHWruAo6uSb1AjZvQbtw8ZEe9m+ND1O+oXOhF45AFbRInFglP9AwsshTGp hTctH32Yv0ytGI0ldDAqSlBbs6vbJXjBn3wSY089vy/ZFn2iwrADabRPbaPHvi2aRFEn OPvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=F1RP2OspDC+HtgmzVL11U7wFYzJf49Wo+cxZIgkDxc8=; b=cd0QsY6/cTkAZBi1TN469S3gyc4xyBtXD1tOHFIHk4md9J0KX7kCWys6YpPCOHZqzk gqwAX7jqITRv2G+qm0qJOXfFYFaIgEsZ5qeHyQFAda6Gg77YVceTPRtRq58zcRq4mTPX qMqyvS2Krl9IUu6mruxohtaYEjfjH6YaNOoaXRqyhje2gm8wuUssV5YqFi5UxZH6bsD+ AB0tJ4LcJlIXxyZFuLjJ3s+0OhgdK3QY2Sf5FbZEA8me1/50QvbBebHL9FQjU+rzLVhw XzX0YcmHhXQ6G8sV9EYc2K/LU3wZcx5KpjZEzsZMWpVopI+gODSWGIIzoXYODDhF1r91 GQNw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p8-20020a17090635c800b0072629f000a0si35554509ejb.134.2022.07.05.00.45.33; Tue, 05 Jul 2022 00:45:57 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229978AbiGEHin (ORCPT + 99 others); Tue, 5 Jul 2022 03:38:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229794AbiGEHik (ORCPT ); Tue, 5 Jul 2022 03:38:40 -0400 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D904BFA for ; Tue, 5 Jul 2022 00:38:38 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R241e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0VIR3n6g_1657006704; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VIR3n6g_1657006704) by smtp.aliyun-inc.com; Tue, 05 Jul 2022 15:38:35 +0800 From: Jiapeng Chong To: mingo@redhat.com Cc: 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, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH] sched/fair: fix boolreturn.cocci warning Date: Tue, 5 Jul 2022 15:38:22 +0800 Message-Id: <20220705073822.7276-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham 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 Return statements in functions returning bool should use true/false instead of 1/0. This was found by coccicheck: ./kernel/sched/fair.c:9988:9-10: WARNING: return of 0/1 in function 'imbalanced_active_balance' with return type bool. Signed-off-by: Jiapeng Chong --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index ac64b5bb7cc9..814235b5477a 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9985,9 +9985,9 @@ imbalanced_active_balance(struct lb_env *env) */ if ((env->migration_type == migrate_task) && (sd->nr_balance_failed > sd->cache_nice_tries+2)) - return 1; + return true; - return 0; + return false; } static int need_active_balance(struct lb_env *env) -- 2.20.1.7.g153144c