提交 9733e4f0 编写于 作者: P Paul E. McKenney

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: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
上级 79619cf5
...@@ -94,7 +94,7 @@ static inline void rcu_virt_note_context_switch(int cpu) ...@@ -94,7 +94,7 @@ static inline void rcu_virt_note_context_switch(int cpu)
/* /*
* Return the number of grace periods. * Return the number of grace periods.
*/ */
static inline long rcu_batches_completed(void) static inline unsigned long rcu_batches_completed(void)
{ {
return 0; return 0;
} }
...@@ -102,7 +102,7 @@ static inline long rcu_batches_completed(void) ...@@ -102,7 +102,7 @@ static inline long rcu_batches_completed(void)
/* /*
* Return the number of bottom-half grace periods. * Return the number of bottom-half grace periods.
*/ */
static inline long rcu_batches_completed_bh(void) static inline unsigned long rcu_batches_completed_bh(void)
{ {
return 0; return 0;
} }
......
...@@ -81,9 +81,9 @@ void cond_synchronize_rcu(unsigned long oldstate); ...@@ -81,9 +81,9 @@ void cond_synchronize_rcu(unsigned long oldstate);
extern unsigned long rcutorture_testseq; extern unsigned long rcutorture_testseq;
extern unsigned long rcutorture_vernum; extern unsigned long rcutorture_vernum;
long rcu_batches_completed(void); unsigned long rcu_batches_completed(void);
long rcu_batches_completed_bh(void); unsigned long rcu_batches_completed_bh(void);
long rcu_batches_completed_sched(void); unsigned long rcu_batches_completed_sched(void);
void show_rcu_gp_kthreads(void); void show_rcu_gp_kthreads(void);
void rcu_force_quiescent_state(void); void rcu_force_quiescent_state(void);
......
...@@ -317,7 +317,7 @@ static int rcu_pending(void); ...@@ -317,7 +317,7 @@ static int rcu_pending(void);
/* /*
* Return the number of RCU-sched batches processed thus far for debug & stats. * Return the number of RCU-sched batches processed thus far for debug & stats.
*/ */
long rcu_batches_completed_sched(void) unsigned long rcu_batches_completed_sched(void)
{ {
return rcu_sched_state.completed; return rcu_sched_state.completed;
} }
...@@ -326,7 +326,7 @@ EXPORT_SYMBOL_GPL(rcu_batches_completed_sched); ...@@ -326,7 +326,7 @@ EXPORT_SYMBOL_GPL(rcu_batches_completed_sched);
/* /*
* Return the number of RCU BH batches processed thus far for debug & stats. * Return the number of RCU BH batches processed thus far for debug & stats.
*/ */
long rcu_batches_completed_bh(void) unsigned long rcu_batches_completed_bh(void)
{ {
return rcu_bh_state.completed; return rcu_bh_state.completed;
} }
......
...@@ -546,7 +546,7 @@ DECLARE_PER_CPU(char, rcu_cpu_has_work); ...@@ -546,7 +546,7 @@ DECLARE_PER_CPU(char, rcu_cpu_has_work);
/* Forward declarations for rcutree_plugin.h */ /* Forward declarations for rcutree_plugin.h */
static void rcu_bootup_announce(void); static void rcu_bootup_announce(void);
long rcu_batches_completed(void); unsigned long rcu_batches_completed(void);
static void rcu_preempt_note_context_switch(void); static void rcu_preempt_note_context_switch(void);
static int rcu_preempt_blocked_readers_cgp(struct rcu_node *rnp); static int rcu_preempt_blocked_readers_cgp(struct rcu_node *rnp);
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
......
...@@ -117,7 +117,7 @@ static void __init rcu_bootup_announce(void) ...@@ -117,7 +117,7 @@ static void __init rcu_bootup_announce(void)
* Return the number of RCU-preempt batches processed thus far * Return the number of RCU-preempt batches processed thus far
* for debug and statistics. * for debug and statistics.
*/ */
static long rcu_batches_completed_preempt(void) static unsigned long rcu_batches_completed_preempt(void)
{ {
return rcu_preempt_state.completed; return rcu_preempt_state.completed;
} }
...@@ -126,7 +126,7 @@ EXPORT_SYMBOL_GPL(rcu_batches_completed_preempt); ...@@ -126,7 +126,7 @@ EXPORT_SYMBOL_GPL(rcu_batches_completed_preempt);
/* /*
* Return the number of RCU batches processed thus far for debug & stats. * Return the number of RCU batches processed thus far for debug & stats.
*/ */
long rcu_batches_completed(void) unsigned long rcu_batches_completed(void)
{ {
return rcu_batches_completed_preempt(); return rcu_batches_completed_preempt();
} }
...@@ -935,7 +935,7 @@ static void __init rcu_bootup_announce(void) ...@@ -935,7 +935,7 @@ static void __init rcu_bootup_announce(void)
/* /*
* Return the number of RCU batches processed thus far for debug & stats. * Return the number of RCU batches processed thus far for debug & stats.
*/ */
long rcu_batches_completed(void) unsigned long rcu_batches_completed(void)
{ {
return rcu_batches_completed_sched(); return rcu_batches_completed_sched();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册