* [PATCH] sched/fair: Use true and false for bool variable
@ 2021-02-18 10:10 Jiapeng Chong
2021-02-18 12:58 ` Peter Zijlstra
2021-02-18 18:06 ` Steven Rostedt
0 siblings, 2 replies; 4+ messages in thread
From: Jiapeng Chong @ 2021-02-18 10:10 UTC (permalink / raw)
To: mingo
Cc: peterz, juri.lelli, vincent.guittot, dietmar.eggemann, rostedt,
bsegall, mgorman, bristot, linux-kernel, Jiapeng Chong
Fix the following coccicheck warnings:
./kernel/sched/fair.c:9504:9-10: WARNING: return of 0/1 in function
'voluntary_active_balance' with return type bool.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.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 04a3ce2..cf78337 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9501,7 +9501,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.
@@ -9513,13 +9513,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->migration_type == migrate_misfit)
- 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] 4+ messages in thread
* Re: [PATCH] sched/fair: Use true and false for bool variable
2021-02-18 10:10 [PATCH] sched/fair: Use true and false for bool variable Jiapeng Chong
@ 2021-02-18 12:58 ` Peter Zijlstra
2021-02-18 18:06 ` Steven Rostedt
1 sibling, 0 replies; 4+ messages in thread
From: Peter Zijlstra @ 2021-02-18 12:58 UTC (permalink / raw)
To: Jiapeng Chong
Cc: mingo, juri.lelli, vincent.guittot, dietmar.eggemann, rostedt,
bsegall, mgorman, bristot, linux-kernel
On Thu, Feb 18, 2021 at 06:10:11PM +0800, Jiapeng Chong wrote:
> Fix the following coccicheck warnings:
>
> ./kernel/sched/fair.c:9504:9-10: WARNING: return of 0/1 in function
> 'voluntary_active_balance' with return type bool.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
You and your robot are welcomed to my /dev/null filter. I'm sick and
tired of telling you to stop sending these useless patches.
YCOQhImbjjJaM/Qe@hirez.programming.kicks-ass.net
YAmiG3FLMYKwF0jV@hirez.programming.kicks-ass.net
20201109125543.GJ2611@hirez.programming.kicks-ass.net
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sched/fair: Use true and false for bool variable
2021-02-18 10:10 [PATCH] sched/fair: Use true and false for bool variable Jiapeng Chong
2021-02-18 12:58 ` Peter Zijlstra
@ 2021-02-18 18:06 ` Steven Rostedt
1 sibling, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2021-02-18 18:06 UTC (permalink / raw)
To: Jiapeng Chong
Cc: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
bsegall, mgorman, bristot, linux-kernel
On Thu, 18 Feb 2021 18:10:11 +0800
Jiapeng Chong <jiapeng.chong@linux.alibaba.com> wrote:
> Fix the following coccicheck warnings:
>
> ./kernel/sched/fair.c:9504:9-10: WARNING: return of 0/1 in function
> 'voluntary_active_balance' with return type bool.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.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 04a3ce2..cf78337 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -9501,7 +9501,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.
> @@ -9513,13 +9513,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->migration_type == migrate_misfit)
> - return 1;
> + return true;
>
> - return 0;
> + return false;
> }
>
> static int need_active_balance(struct lb_env *env)
I think this would be a more interesting version of the patch. Would it
make your bot stop sending them??
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 04a3ce2..cf78337 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9501,7 +9501,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 '/'/'/';
/*
* The dst_cpu is idle and the src_cpu CPU has only 1 CFS task.
@@ -9513,13 +9513,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 '/'/'/';
}
if (env->migration_type == migrate_misfit)
- return 1;
+ return '/'/'/';
- return 0;
+ return '-'-'-';
}
static int need_active_balance(struct lb_env *env)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] sched/fair: Use true and false for bool variable
@ 2021-03-08 8:23 Yang Li
0 siblings, 0 replies; 4+ messages in thread
From: Yang Li @ 2021-03-08 8:23 UTC (permalink / raw)
To: mingo
Cc: peterz, juri.lelli, vincent.guittot, dietmar.eggemann, rostedt,
bsegall, mgorman, bristot, linux-kernel, Yang Li
Fix the following coccicheck warning:
./kernel/sched/fair.c:9497:9-10: WARNING: return of 0/1 in function
'imbalanced_active_balance' with return type bool
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
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 794c2cb..5388fde 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9494,9 +9494,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] 4+ messages in thread
end of thread, other threads:[~2021-03-08 8:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18 10:10 [PATCH] sched/fair: Use true and false for bool variable Jiapeng Chong
2021-02-18 12:58 ` Peter Zijlstra
2021-02-18 18:06 ` Steven Rostedt
2021-03-08 8:23 Yang Li
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.