summaryrefslogtreecommitdiffstats
path: root/kernel/rcu
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2015-03-04 10:39:27 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2015-05-27 15:57:59 -0400
commitb28a7c016618e5e32e0703e3dd111dbba02715ff (patch)
tree87f1d54c122911059cfac2b1933ea07b62d6a7de /kernel/rcu
parent727b705baf7d091a9bc5494d7f1d9699b6932531 (diff)
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')
-rw-r--r--kernel/rcu/tree.c2
-rw-r--r--kernel/rcu/tree_plugin.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 0628df155970..f031700514dd 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -110,7 +110,7 @@ struct rcu_state sname##_state = { \
110RCU_STATE_INITIALIZER(rcu_sched, 's', call_rcu_sched); 110RCU_STATE_INITIALIZER(rcu_sched, 's', call_rcu_sched);
111RCU_STATE_INITIALIZER(rcu_bh, 'b', call_rcu_bh); 111RCU_STATE_INITIALIZER(rcu_bh, 'b', call_rcu_bh);
112 112
113static struct rcu_state *rcu_state_p; 113static struct rcu_state *const rcu_state_p;
114LIST_HEAD(rcu_struct_flavors); 114LIST_HEAD(rcu_struct_flavors);
115 115
116/* Increase (but not decrease) the CONFIG_RCU_FANOUT_LEAF at boot time. */ 116/* Increase (but not decrease) the CONFIG_RCU_FANOUT_LEAF at boot time. */
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)
100#ifdef CONFIG_PREEMPT_RCU 100#ifdef CONFIG_PREEMPT_RCU
101 101
102RCU_STATE_INITIALIZER(rcu_preempt, 'p', call_rcu); 102RCU_STATE_INITIALIZER(rcu_preempt, 'p', call_rcu);
103static struct rcu_state *rcu_state_p = &rcu_preempt_state; 103static struct rcu_state *const rcu_state_p = &rcu_preempt_state;
104 104
105static int rcu_preempted_readers_exp(struct rcu_node *rnp); 105static int rcu_preempted_readers_exp(struct rcu_node *rnp);
106static void rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp, 106static void rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp,
@@ -834,7 +834,7 @@ void exit_rcu(void)
834 834
835#else /* #ifdef CONFIG_PREEMPT_RCU */ 835#else /* #ifdef CONFIG_PREEMPT_RCU */
836 836
837static struct rcu_state *rcu_state_p = &rcu_sched_state; 837static struct rcu_state *const rcu_state_p = &rcu_sched_state;
838 838
839/* 839/*
840 * Tell them what RCU they are running. 840 * Tell them what RCU they are running.