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] [day] [month] [year] [list]
Date:   Mon, 30 Mar 2020 14:12:57 -0700
From:   "Paul E. McKenney" <paulmck@...nel.org>
To:     Jules Irenge <jbi.octave@...il.com>
Cc:     julia.lawall@...6.fr, boqun.feng@...il.com,
        Josh Triplett <josh@...htriplett.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Lai Jiangshan <jiangshanlai@...il.com>,
        Joel Fernandes <joel@...lfernandes.org>,
        "open list:READ-COPY UPDATE (RCU)" <rcu@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 06/10] rcu: Replace assigned pointer ret value by
 corresponding boolean value

On Fri, Mar 27, 2020 at 09:23:53PM +0000, Jules Irenge wrote:
> Coccinelle reports warnings at rcu_read_lock_held_common()
> 
> WARNING: Assignment of 0/1 to bool variable
> 
> To fix this,
> the assigned  pointer ret values are replaced by corresponding boolean value.
> Given that ret is a pointer of bool type
> 
> Signed-off-by: Jules Irenge <jbi.octave@...il.com>

Queued for further review and testing, thank you!

							Thanx, Paul

> ---
>  kernel/rcu/update.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
> index 6c4b862f57d6..24fb64fd1a1a 100644
> --- a/kernel/rcu/update.c
> +++ b/kernel/rcu/update.c
> @@ -98,15 +98,15 @@ module_param(rcu_normal_after_boot, int, 0);
>  static bool rcu_read_lock_held_common(bool *ret)
>  {
>  	if (!debug_lockdep_rcu_enabled()) {
> -		*ret = 1;
> +		*ret = true;
>  		return true;
>  	}
>  	if (!rcu_is_watching()) {
> -		*ret = 0;
> +		*ret = false;
>  		return true;
>  	}
>  	if (!rcu_lockdep_current_cpu_online()) {
> -		*ret = 0;
> +		*ret = false;
>  		return true;
>  	}
>  	return false;
> -- 
> 2.25.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ