lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <jhjpnbg6lkf.mognet@arm.com>
Date:   Thu, 07 May 2020 12:17:36 +0100
From:   Valentin Schneider <valentin.schneider@....com>
To:     Jason Yan <yanaijie@...wei.com>
Cc:     mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched/fair: Return true,false in voluntary_active_balance()


On 07/05/20 12:06, Jason Yan wrote:
> Fix the following coccicheck warning:
>
> kernel/sched/fair.c:9375:9-10: WARNING: return of 0/1 in function
> 'voluntary_active_balance' with return type bool
>

It's perfectly safe to return 0/1 in a boolean function; that said seeing
as this is the second attempt at "fixing" this I'm tempted to say we should
pick it up...

> Signed-off-by: Jason Yan <yanaijie@...wei.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 b3bb4d6e49c3..e8390106ada4 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -9373,7 +9373,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.
> @@ -9385,13 +9385,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)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ