linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched/fair: fix coccinelle warnings
@ 2019-07-15  2:45 Yi Wang
  2019-07-15  9:51 ` Peter Zijlstra
  0 siblings, 1 reply; 2+ messages in thread
From: Yi Wang @ 2019-07-15  2:45 UTC (permalink / raw)
  To: mingo; +Cc: peterz, linux-kernel, xue.zhihong, wang.yi59, up2wing, wang.liang82

This fixes the following coccinelle warning:
./kernel/sched/fair.c:8688:9-10: WARNING: return of 0/1 in function 'voluntary_active_balance' with return type bool

Return type bool instead of 0/1.

Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
 kernel/sched/fair.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 036be95..c44b157 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -8685,7 +8685,7 @@ static struct rq *find_busiest_queue(struct lb_env *env,
 	struct sched_domain *sd = env->sd;
 
 	if (asym_active_balance(env))
-		return 1;
+		return true;
 
 	/*
 	 * The dst_cpu is idle and the src_cpu CPU has only 1 CFS task.
@@ -8697,13 +8697,13 @@ static struct rq *find_busiest_queue(struct lb_env *env,
 	    (env->src_rq->cfs.h_nr_running == 1)) {
 		if ((check_cpu_capacity(env->src_rq, sd)) &&
 		    (capacity_of(env->src_cpu)*sd->imbalance_pct < capacity_of(env->dst_cpu)*100))
-			return 1;
+			return true;
 	}
 
 	if (env->src_grp_type == group_misfit_task)
-		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] 2+ messages in thread

* Re: [PATCH] sched/fair: fix coccinelle warnings
  2019-07-15  2:45 [PATCH] sched/fair: fix coccinelle warnings Yi Wang
@ 2019-07-15  9:51 ` Peter Zijlstra
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Zijlstra @ 2019-07-15  9:51 UTC (permalink / raw)
  To: Yi Wang; +Cc: mingo, linux-kernel, xue.zhihong, up2wing, wang.liang82

On Mon, Jul 15, 2019 at 10:45:26AM +0800, Yi Wang wrote:
> This fixes the following coccinelle warning:
> ./kernel/sched/fair.c:8688:9-10: WARNING: return of 0/1 in function 'voluntary_active_balance' with return type bool
> 
> Return type bool instead of 0/1.

I don't much appreciate these patches. I think 0/1 are perfectly fine
return values for a boolean function.

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

end of thread, other threads:[~2019-07-15  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15  2:45 [PATCH] sched/fair: fix coccinelle warnings Yi Wang
2019-07-15  9:51 ` 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).