linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] kernel:fair: fix boolreturn.cocci warnings
@ 2021-08-24  6:23 CGEL
  2021-08-24  8:15 ` Peter Zijlstra
  0 siblings, 1 reply; 6+ messages in thread
From: CGEL @ 2021-08-24  6:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Peter Zijlstra, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, linux-kernel, Jing Yangyang,
	Zeal Robot

From: Jing Yangyang <jing.yangyang@zte.com.cn>

./kernel/sched/fair.c:9638: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.

Generated by: scripts/coccinelle/misc/boolreturn.cocci

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>
---
 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 d425d11..d90527e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9635,9 +9635,9 @@ static struct rq *find_busiest_queue(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)
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-08-24 14:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-24  6:23 [PATCH linux-next] kernel:fair: fix boolreturn.cocci warnings CGEL
2021-08-24  8:15 ` Peter Zijlstra
2021-08-24  8:22   ` Peter Zijlstra
2021-08-24 13:41     ` Steven Rostedt
2021-08-24 13:42       ` Steven Rostedt
2021-08-24 14:43         ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).