All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	bsegall@google.com, mgorman@suse.de, bristot@redhat.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/fair: Use true and false for bool variable
Date: Thu, 18 Feb 2021 13:06:38 -0500	[thread overview]
Message-ID: <20210218130638.2a293db2@gandalf.local.home> (raw)
In-Reply-To: <1613643011-114108-1-git-send-email-jiapeng.chong@linux.alibaba.com>

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

  parent reply	other threads:[~2021-02-18 19:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-03-08  8:23 Yang Li

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=20210218130638.2a293db2@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=jiapeng.chong@linux.alibaba.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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.