summaryrefslogtreecommitdiffstats
path: root/kernel/rcu/tree_plugin.h
diff options
context:
space:
mode:
authorPaul E. McKenney2015-03-04 16:39:27 +0100
committerPaul E. McKenney2015-05-27 21:57:59 +0200
commitb28a7c016618e5e32e0703e3dd111dbba02715ff (patch)
tree87f1d54c122911059cfac2b1933ea07b62d6a7de /kernel/rcu/tree_plugin.h
parentrcu: Eliminate a few RCU_BOOST #ifdefs in favor of IS_ENABLED() (diff)
downloadkernel-qcow2-linux-b28a7c016618e5e32e0703e3dd111dbba02715ff.tar.gz
kernel-qcow2-linux-b28a7c016618e5e32e0703e3dd111dbba02715ff.tar.xz
kernel-qcow2-linux-b28a7c016618e5e32e0703e3dd111dbba02715ff.zip
rcu: Tell the compiler that rcu_state_p is immutable
This commit adds a "const" tag to the declarations of rcu_state_p, which should allow the compiler to generate better code and also to catch erroneous assignments to this variable. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/tree_plugin.h')
-rw-r--r--kernel/rcu/tree_plugin.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 8f8142778684..18b057adc21a 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -100,7 +100,7 @@ static void __init rcu_bootup_announce_oddness(void)
#ifdef CONFIG_PREEMPT_RCU
RCU_STATE_INITIALIZER(rcu_preempt, 'p', call_rcu);
-static struct rcu_state *rcu_state_p = &rcu_preempt_state;
+static struct rcu_state *const rcu_state_p = &rcu_preempt_state;
static int rcu_preempted_readers_exp(struct rcu_node *rnp);
static void rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp,
@@ -834,7 +834,7 @@ void exit_rcu(void)
#else /* #ifdef CONFIG_PREEMPT_RCU */
-static struct rcu_state *rcu_state_p = &rcu_sched_state;
+static struct rcu_state *const rcu_state_p = &rcu_sched_state;
/*
* Tell them what RCU they are running.