Re: [PATCH] sched/fair: fix boolreturn.cocci warning

From: Joe Perches
Date: Tue Dec 14 2021 - 10:24:42 EST


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@xxxxxxxxx wrote:
>
> > From: Changcheng Deng <deng.changcheng@xxxxxxxxxx>
> >
> > ./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