diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-11-21 15:49:13 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-01-10 22:07:56 -0500 |
commit | 9733e4f0a973a354034f5dd603b4142a3095c85f (patch) | |
tree | cf272877ec7a0e2ddf0cafdd78663ed38a32805e | |
parent | 79619cf5151257f82a4c016b02283e2ceb4b63ce (diff) |
rcu: Make _batches_completed() functions return unsigned long
Long ago, the various ->completed fields were of type long, but now are
unsigned long due to signed-integer-overflow concerns. However, the
various _batches_completed() functions remained of type long, even though
their only purpose in life is to return the corresponding ->completed
field. This patch cleans this up by changing these functions' return
types to unsigned long.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r-- | include/linux/rcutiny.h | 4 | ||||
-rw-r--r-- | include/linux/rcutree.h | 6 | ||||
-rw-r--r-- | kernel/rcu/tree.c | 4 | ||||
-rw-r--r-- | kernel/rcu/tree.h | 2 | ||||
-rw-r--r-- | kernel/rcu/tree_plugin.h | 6 |
5 files changed, 11 insertions, 11 deletions
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 0e5366200154..91f7e4c37800 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
@@ -94,7 +94,7 @@ static inline void rcu_virt_note_context_switch(int cpu) | |||
94 | /* | 94 | /* |
95 | * Return the number of grace periods. | 95 | * Return the number of grace periods. |
96 | */ | 96 | */ |
97 | static inline long rcu_batches_completed(void) | 97 | static inline unsigned long rcu_batches_completed(void) |
98 | { | 98 | { |
99 | return 0; | 99 | return 0; |
100 | } | 100 | } |
@@ -102,7 +102,7 @@ static inline long rcu_batches_completed(void) | |||
102 | /* | 102 | /* |
103 | * Return the number of bottom-half grace periods. | 103 | * Return the number of bottom-half grace periods. |
104 | */ | 104 | */ |
105 | static inline long rcu_batches_completed_bh(void) | 105 | static inline unsigned long rcu_batches_completed_bh(void) |
106 | { | 106 | { |
107 | return 0; | 107 | return 0; |
108 | } | 108 | } |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 52953790dcca..9885bfb6b123 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -81,9 +81,9 @@ void cond_synchronize_rcu(unsigned long oldstate); | |||
81 | 81 | ||
82 | extern unsigned long rcutorture_testseq; | 82 | extern unsigned long rcutorture_testseq; |
83 | extern unsigned long rcutorture_vernum; | 83 | extern unsigned long rcutorture_vernum; |
84 | long rcu_batches_completed(void); | 84 | unsigned long rcu_batches_completed(void); |
85 | long rcu_batches_completed_bh(void); | 85 | unsigned long rcu_batches_completed_bh(void); |
86 | long rcu_batches_completed_sched(void); | 86 | unsigned long rcu_batches_completed_sched(void); |
87 | void show_rcu_gp_kthreads(void); | 87 | void show_rcu_gp_kthreads(void); |
88 | 88 | ||
89 | void rcu_force_quiescent_state(void); | 89 | void rcu_force_quiescent_state(void); |
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 4c106fcc0d54..e26d78712e16 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
@@ -317,7 +317,7 @@ static int rcu_pending(void); | |||
317 | /* | 317 | /* |
318 | * Return the number of RCU-sched batches processed thus far for debug & stats. | 318 | * Return the number of RCU-sched batches processed thus far for debug & stats. |
319 | */ | 319 | */ |
320 | long rcu_batches_completed_sched(void) | 320 | unsigned long rcu_batches_completed_sched(void) |
321 | { | 321 | { |
322 | return rcu_sched_state.completed; | 322 | return rcu_sched_state.completed; |
323 | } | 323 | } |
@@ -326,7 +326,7 @@ EXPORT_SYMBOL_GPL(rcu_batches_completed_sched); | |||
326 | /* | 326 | /* |
327 | * Return the number of RCU BH batches processed thus far for debug & stats. | 327 | * Return the number of RCU BH batches processed thus far for debug & stats. |
328 | */ | 328 | */ |
329 | long rcu_batches_completed_bh(void) | 329 | unsigned long rcu_batches_completed_bh(void) |
330 | { | 330 | { |
331 | return rcu_bh_state.completed; | 331 | return rcu_bh_state.completed; |
332 | } | 332 | } |
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index 8e7b1843896e..1a07d7379ac6 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h | |||
@@ -546,7 +546,7 @@ DECLARE_PER_CPU(char, rcu_cpu_has_work); | |||
546 | 546 | ||
547 | /* Forward declarations for rcutree_plugin.h */ | 547 | /* Forward declarations for rcutree_plugin.h */ |
548 | static void rcu_bootup_announce(void); | 548 | static void rcu_bootup_announce(void); |
549 | long rcu_batches_completed(void); | 549 | unsigned long rcu_batches_completed(void); |
550 | static void rcu_preempt_note_context_switch(void); | 550 | static void rcu_preempt_note_context_switch(void); |
551 | static int rcu_preempt_blocked_readers_cgp(struct rcu_node *rnp); | 551 | static int rcu_preempt_blocked_readers_cgp(struct rcu_node *rnp); |
552 | #ifdef CONFIG_HOTPLUG_CPU | 552 | #ifdef CONFIG_HOTPLUG_CPU |
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 3ec85cb5d544..f69300d4a51f 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h | |||
@@ -117,7 +117,7 @@ static void __init rcu_bootup_announce(void) | |||
117 | * Return the number of RCU-preempt batches processed thus far | 117 | * Return the number of RCU-preempt batches processed thus far |
118 | * for debug and statistics. | 118 | * for debug and statistics. |
119 | */ | 119 | */ |
120 | static long rcu_batches_completed_preempt(void) | 120 | static unsigned long rcu_batches_completed_preempt(void) |
121 | { | 121 | { |
122 | return rcu_preempt_state.completed; | 122 | return rcu_preempt_state.completed; |
123 | } | 123 | } |
@@ -126,7 +126,7 @@ EXPORT_SYMBOL_GPL(rcu_batches_completed_preempt); | |||
126 | /* | 126 | /* |
127 | * Return the number of RCU batches processed thus far for debug & stats. | 127 | * Return the number of RCU batches processed thus far for debug & stats. |
128 | */ | 128 | */ |
129 | long rcu_batches_completed(void) | 129 | unsigned long rcu_batches_completed(void) |
130 | { | 130 | { |
131 | return rcu_batches_completed_preempt(); | 131 | return rcu_batches_completed_preempt(); |
132 | } | 132 | } |
@@ -935,7 +935,7 @@ static void __init rcu_bootup_announce(void) | |||
935 | /* | 935 | /* |
936 | * Return the number of RCU batches processed thus far for debug & stats. | 936 | * Return the number of RCU batches processed thus far for debug & stats. |
937 | */ | 937 | */ |
938 | long rcu_batches_completed(void) | 938 | unsigned long rcu_batches_completed(void) |
939 | { | 939 | { |
940 | return rcu_batches_completed_sched(); | 940 | return rcu_batches_completed_sched(); |
941 | } | 941 | } |