diff options
author | Paul E. McKenney <paulmck@linux.ibm.com> | 2019-05-22 09:35:11 -0700 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.ibm.com> | 2019-08-13 14:35:49 -0700 |
commit | 969974e5c51e717fc9070b00eb2f61ae589ed13d (patch) | |
tree | d39d177c68c63f46ae691b487a97113ef499133e /kernel/rcu/tree_plugin.h | |
parent | 921bb5fad11c0e8ec5f7625547552b252281f4de (diff) | |
download | linux-969974e5c51e717fc9070b00eb2f61ae589ed13d.tar.gz linux-969974e5c51e717fc9070b00eb2f61ae589ed13d.tar.bz2 linux-969974e5c51e717fc9070b00eb2f61ae589ed13d.zip |
rcu/nocb: Suppress uninitialized false-positive in nocb_gp_wait()
Some compilers complain that wait_gp_seq might be used uninitialized
in nocb_gp_wait(). This cannot actually happen because when wait_gp_seq
is uninitialized, needwait_gp must be false, which prevents wait_gp_seq
from being used. But this analysis is apparently beyond some compilers,
so this commit adds a bogus initialization of wait_gp_seq for the sole
purpose of suppressing the false-positive warning.
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Diffstat (limited to 'kernel/rcu/tree_plugin.h')
-rw-r--r-- | kernel/rcu/tree_plugin.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 1847fffdfa0a..c1dfbac8cd39 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -1668,12 +1668,12 @@ static void nocb_gp_wait(struct rcu_data *my_rdp) unsigned long cur_gp_seq; unsigned long flags; bool gotcbs; - bool needwait_gp = false; + bool needwait_gp = false; // This prevents actual uninitialized use. bool needwake; bool needwake_gp; struct rcu_data *rdp; struct rcu_node *rnp; - unsigned long wait_gp_seq; + unsigned long wait_gp_seq = 0; // Suppress "use uninitialized" warning. /* * Each pass through the following loop checks for CBs and for the |