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]
Date:   Tue, 14 Dec 2021 09:14:46 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     cgel.zte@...il.com
Cc:     mingo@...hat.com, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        bsegall@...gle.com, mgorman@...e.de, bristot@...hat.com,
        linux-kernel@...r.kernel.org,
        Changcheng Deng <deng.changcheng@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] sched/fair: fix boolreturn.cocci warning


I'll save Peter Zijlstra time from replying to this.

On Tue, 14 Dec 2021 11:38:45 +0000
cgel.zte@...il.com wrote:

> From: Changcheng Deng <deng.changcheng@....com.cn>
> 
> ./kernel/sched/fair.c: 9781: 9-10: WARNING: return of 0/1 in function
> 'imbalanced_active_balance' with return type bool
> 
> Return statements in functions returning bool should use true/false
> instead of 1/0.

This is a stupid warning. In C "1" is the same as "true" and "0" is the
same as "false". 

This is a bogus error message and something not needed to be fixed.

Please remove these checks from your scripts.

NACK

-- Steve

> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Changcheng Deng <deng.changcheng@....com.cn>
> ---
>  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 ac5e55441cab..0e62fd7ac0e6 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -9778,9 +9778,9 @@ imbalanced_active_balance(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)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ