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

* Re: [PATCH linux-next] kernel:fair: fix boolreturn.cocci warnings
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Zijlstra @ 2021-08-24  8:15 UTC (permalink / raw)
  To: CGEL
  Cc: Ingo Molnar, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, linux-kernel, Jing Yangyang,
	Zeal Robot

On Mon, Aug 23, 2021 at 11:23:59PM -0700, CGEL wrote:
> 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>

*sigh*, another stupid robot sending stupid patches..

/me goes create another mail filter...

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

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

On Tue, Aug 24, 2021 at 10:15:54AM +0200, Peter Zijlstra wrote:
> On Mon, Aug 23, 2021 at 11:23:59PM -0700, CGEL wrote:
> > 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>
> 
> *sigh*, another stupid robot sending stupid patches..
> 
> /me goes create another mail filter...

Here, the hunk of sieve script, incase other people want to use it too.


#SCRIPTNAME: Zeal Robot
if body :text :contains "Reported-by: Zeal Robot <zealci@zte.com.cn>"
{
    fileinto "SPAM";
    stop;
}


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

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

On Tue, 24 Aug 2021 10:22:49 +0200
Peter Zijlstra <peterz@infradead.org> wrote:

> On Tue, Aug 24, 2021 at 10:15:54AM +0200, Peter Zijlstra wrote:
> > On Mon, Aug 23, 2021 at 11:23:59PM -0700, CGEL wrote:  
> > > 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>  
> > 
> > *sigh*, another stupid robot sending stupid patches..
> > 
> > /me goes create another mail filter...  
> 
> Here, the hunk of sieve script, incase other people want to use it too.
> 
> 
> #SCRIPTNAME: Zeal Robot
> if body :text :contains "Reported-by: Zeal Robot <zealci@zte.com.cn>"
> {
>     fileinto "SPAM";
>     stop;
> }

Doesn't hurt to just take the patch and then you wont have to spend
time on new robots flagging this as a "bug".

-- Steve

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

* Re: [PATCH linux-next] kernel:fair: fix boolreturn.cocci warnings
  2021-08-24 13:41     ` Steven Rostedt
@ 2021-08-24 13:42       ` Steven Rostedt
  2021-08-24 14:43         ` Peter Zijlstra
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2021-08-24 13:42 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: CGEL, Ingo Molnar, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
	Ben Segall, Mel Gorman, Daniel Bristot de Oliveira, linux-kernel,
	Jing Yangyang, Zeal Robot

On Tue, 24 Aug 2021 09:41:28 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> Doesn't hurt to just take the patch and then you wont have to spend
> time on new robots flagging this as a "bug".

Or if you don't want to give credit to theses silly robots, just go
through the code yourself, and make one big cleanup. It's really
trivial work.

-- Steve

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

* Re: [PATCH linux-next] kernel:fair: fix boolreturn.cocci warnings
  2021-08-24 13:42       ` Steven Rostedt
@ 2021-08-24 14:43         ` Peter Zijlstra
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Zijlstra @ 2021-08-24 14:43 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: CGEL, Ingo Molnar, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
	Ben Segall, Mel Gorman, Daniel Bristot de Oliveira, linux-kernel,
	Jing Yangyang, Zeal Robot

On Tue, Aug 24, 2021 at 09:42:44AM -0400, Steven Rostedt wrote:
> On Tue, 24 Aug 2021 09:41:28 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
> 
> > Doesn't hurt to just take the patch and then you wont have to spend
> > time on new robots flagging this as a "bug".
> 
> Or if you don't want to give credit to theses silly robots, just go
> through the code yourself, and make one big cleanup. It's really
> trivial work.

I fundamentally disagree with the patches. 0 is a perfectly fine
spelling of false. And if they'd spend half a minute using google, I'm
sure they would have found me proclaiming as such.

Why should I waste time on people that can't be arsed to do their
homework?

^ permalink raw reply	[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).