From: Jules Irenge <jbi.octave@gmail.com>
To: julia.lawall@lip6.fr
Cc: boqun.feng@gmail.com, Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
linux-kernel@vger.kernel.org (open list:SCHEDULER)
Subject: [PATCH 07/10] sched/fair: Replace 1 and 0 by boolean value
Date: Fri, 27 Mar 2020 21:23:54 +0000 [thread overview]
Message-ID: <20200327212358.5752-8-jbi.octave@gmail.com> (raw)
In-Reply-To: <20200327212358.5752-1-jbi.octave@gmail.com>
Coccinelle reports a warning at voluntary_active_balance
WARNING: return of 0/1 in function voluntary_active_balance with return type bool
To fix this, 1 is replaced by true and 0 by false.
Given that voluntary_active_balance() is of bool type.
This fixes the warnings.
Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
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 c1217bfe5e81..b11bb08687a9 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9082,7 +9082,7 @@ voluntary_active_balance(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.
@@ -9094,13 +9094,13 @@ voluntary_active_balance(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->migration_type == migrate_misfit)
- return 1;
+ return true;
- return 0;
+ return false;
}
static int need_active_balance(struct lb_env *env)
--
2.25.1
next prev parent reply other threads:[~2020-03-27 21:24 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <0/10>
[not found] ` <20200327212358.5752-1-jbi.octave@gmail.com>
2020-03-27 21:23 ` [PATCH 01/10] locking/rtmutex: Remove Comparison to bool Jules Irenge
2020-03-28 11:28 ` Thomas Gleixner
2020-03-28 12:02 ` Jules Irenge
2020-03-28 12:44 ` Thomas Gleixner
2020-03-27 21:23 ` [PATCH 02/10] sched/topology: Replace 1 and 0 by boolean value Jules Irenge
2020-03-30 11:27 ` Peter Zijlstra
2020-04-03 16:23 ` Jules Irenge
2020-03-27 21:23 ` [PATCH 03/10] cpu: Remove Comparison to bool Jules Irenge
2020-03-28 11:29 ` Thomas Gleixner
2020-03-27 21:23 ` [PATCH 04/10] irq: Replace 1 by true Jules Irenge
2020-03-27 21:23 ` [PATCH 05/10] softirq: Replace BUG() after if statement with BUG_ON Jules Irenge
2020-03-28 11:22 ` Thomas Gleixner
2020-03-27 21:23 ` [PATCH 06/10] rcu: Replace assigned pointer ret value by corresponding boolean value Jules Irenge
2020-03-30 21:12 ` Paul E. McKenney
2020-03-27 21:23 ` Jules Irenge [this message]
2020-03-30 11:29 ` [PATCH 07/10] sched/fair: Replace 1 and 0 by " Peter Zijlstra
2020-03-27 21:23 ` [PATCH 08/10] trace: Replace printk and WARN_ON with WARN Jules Irenge
2020-03-27 21:23 ` [PATCH 09/10] kernel/sysctl.c: Replace 1 and 0 by corresponding boolean value Jules Irenge
2020-03-28 21:24 ` Kees Cook
2020-03-27 21:23 ` [PATCH 10/10] trace: Replace printk and WARN_ON with WARN Jules Irenge
2020-03-27 22:51 ` Steven Rostedt
2020-03-28 12:00 ` Jules Irenge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200327212358.5752-8-jbi.octave@gmail.com \
--to=jbi.octave@gmail.com \
--cc=boqun.feng@gmail.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=julia.lawall@lip6.fr \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.