summaryrefslogtreecommitdiffstats
path: root/kernel/rcu
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2015-03-09 19:51:17 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2015-05-27 15:59:02 -0400
commit3eaaaf6cd6d7fbaf552cc543ccb93d7da81f43ec (patch)
tree2d4857df44b8b855ae57741b870afbba5183b405 /kernel/rcu
parenteab128e8305f2bc4c91406031aab26d86fecced6 (diff)
rcu: Shut up spurious gcc uninitialized-variable warning
Because gcc doesn't realize that rcu_num_lvls must be strictly greater than zero, some versions give a spurious warning about levelcnt[0] being uninitialized in rcu_init_one(). This commit updates the condition on the pre-existing panic() in order to educate gcc on this point. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/tree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index c34422d92aa9..9b076b284695 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3982,9 +3982,9 @@ static void __init rcu_init_one(struct rcu_state *rsp,
3982 3982
3983 BUILD_BUG_ON(MAX_RCU_LVLS > ARRAY_SIZE(buf)); /* Fix buf[] init! */ 3983 BUILD_BUG_ON(MAX_RCU_LVLS > ARRAY_SIZE(buf)); /* Fix buf[] init! */
3984 3984
3985 /* Silence gcc 4.8 warning about array index out of range. */ 3985 /* Silence gcc 4.8 false positive about array index out of range. */
3986 if (rcu_num_lvls > RCU_NUM_LVLS) 3986 if (rcu_num_lvls <= 0 || rcu_num_lvls > RCU_NUM_LVLS)
3987 panic("rcu_init_one: rcu_num_lvls overflow"); 3987 panic("rcu_init_one: rcu_num_lvls out of range");
3988 3988
3989 /* Initialize the level-tracking arrays. */ 3989 /* Initialize the level-tracking arrays. */
3990 3990