rcu: Replace assigned pointer ret value by corresponding boolean value
authorJules Irenge <jbi.octave@gmail.com>
Fri, 27 Mar 2020 21:23:53 +0000 (21:23 +0000)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 27 Apr 2020 18:01:16 +0000 (11:01 -0700)
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@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/update.c

index 72461dd80d292c3dd7334b4689bec61883679db1..17f23569e21a9da72c1c92f5f10c00f5e0d0468f 100644 (file)
@@ -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;