All of lore.kernel.org
 help / color / mirror / Atom feed
From: davidcomponentone@gmail.com
To: mingo@redhat.com
Cc: davidcomponentone@gmail.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,
	linux-kernel@vger.kernel.org, Yang Guang <yang.guang5@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: [PATCH] sched/fair: fix boolreturn.cocci warning
Date: Fri, 14 Jan 2022 08:12:07 +0800	[thread overview]
Message-ID: <190b5c2f2f2fb9cc775fce8daed72bf893be48a4.1642065293.git.davidcomponentone@gmail.com> (raw)

From: Yang Guang <yang.guang5@zte.com.cn>

The coccinelle report
./kernel/sched/fair.c:9726:9-10:
WARNING: return of 0/1 in function 'imbalanced_active_balance'
with return type bool

Return statements in functions returning bool should use true/false
instead of 1/0.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Yang Guang <yang.guang5@zte.com.cn>
Signed-off-by: David Yang <davidcomponentone@gmail.com>
---
 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 095b0aa378df..354a36c1ab69 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9723,9 +9723,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.30.2


             reply	other threads:[~2022-01-14  0:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14  0:12 davidcomponentone [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-07-05  7:38 [PATCH] sched/fair: fix boolreturn.cocci warning Jiapeng Chong
2022-07-05 14:31 ` Steven Rostedt
2022-03-17  1:47 Jiapeng Chong
2021-12-14 11:38 cgel.zte
2021-12-14 14:14 ` Steven Rostedt
2021-12-14 15:24   ` Joe Perches
2021-12-14 15:52     ` Steven Rostedt
2021-12-14 20:00       ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=190b5c2f2f2fb9cc775fce8daed72bf893be48a4.1642065293.git.davidcomponentone@gmail.com \
    --to=davidcomponentone@gmail.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=yang.guang5@zte.com.cn \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.