lkml.org 
[lkml]   [2021]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] sched/fair: fix boolreturn.cocci warning
From
Date
On Tue, 2021-12-14 at 09:14 -0500, Steven Rostedt wrote:
> I'll save Peter Zijlstra time from replying to this.
>
> On Tue, 14 Dec 2021 11:38:45 +0000
> cgel.zte@gmail.com wrote:
>
> > From: Changcheng Deng <deng.changcheng@zte.com.cn>
> >
> > ./kernel/sched/fair.c: 9781: 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.
>
> This is a stupid warning. In C "1" is the same as "true" and "0" is the
> same as "false".
>
> This is a bogus error message and something not needed to be fixed.
>
> Please remove these checks from your scripts.
>
> NACK

Perhaps it is more a change for consistency than a fix for correctness.

$ git grep -P 'return\s+(?:true|false)' kernel/sched/ | wc -l
209


\
 
 \ /
  Last update: 2021-12-14 16:24    [W:0.056 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site