diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-03-04 10:39:27 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-05-27 15:57:59 -0400 |
commit | b28a7c016618e5e32e0703e3dd111dbba02715ff (patch) | |
tree | 87f1d54c122911059cfac2b1933ea07b62d6a7de /kernel/rcu | |
parent | 727b705baf7d091a9bc5494d7f1d9699b6932531 (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.c | 2 | ||||
-rw-r--r-- | kernel/rcu/tree_plugin.h | 4 |
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 = { \ | |||
110 | RCU_STATE_INITIALIZER(rcu_sched, 's', call_rcu_sched); | 110 | RCU_STATE_INITIALIZER(rcu_sched, 's', call_rcu_sched); |
111 | RCU_STATE_INITIALIZER(rcu_bh, 'b', call_rcu_bh); | 111 | RCU_STATE_INITIALIZER(rcu_bh, 'b', call_rcu_bh); |
112 | 112 | ||
113 | static struct rcu_state *rcu_state_p; | 113 | static struct rcu_state *const rcu_state_p; |
114 | LIST_HEAD(rcu_struct_flavors); | 114 | LIST_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 | ||
102 | RCU_STATE_INITIALIZER(rcu_preempt, 'p', call_rcu); | 102 | RCU_STATE_INITIALIZER(rcu_preempt, 'p', call_rcu); |
103 | static struct rcu_state *rcu_state_p = &rcu_preempt_state; | 103 | static struct rcu_state *const rcu_state_p = &rcu_preempt_state; |
104 | 104 | ||
105 | static int rcu_preempted_readers_exp(struct rcu_node *rnp); | 105 | static int rcu_preempted_readers_exp(struct rcu_node *rnp); |
106 | static void rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp, | 106 | static 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 | ||
837 | static struct rcu_state *rcu_state_p = &rcu_sched_state; | 837 | static 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. |