rcu: fix sparse warning about rcu_batches_completed_preempt() being non-static
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/9 rcu: fix sparse warning about rcu_batches_completed_preempt() being non-static
fix sparse warning about rcu_batches_completed_preempt() being non-static by marking it as static
--- kernel/rcu/tree_plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/tree_plugin.h +1 -1
@@ -134,7 +134,7 @@ static void __init rcu_bootup_announce(void)* Return the number of RCU-preempt batches processed thus far * for debug and statistics. */ -long rcu_batches_completed_preempt (void ) +static long rcu_batches_completed_preempt (void ) {return rcu_preempt_state.completed; }
Signature · 1 line
1.9.1
PATCH 2/9 rcu: use bool type for return value in rcu_is_watching()
In reply to a message not in the archiveuse a bool type for return in rcu_is_watching()
--- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/tree.c +1 -1
@@ -819,7 +819,7 @@ bool notrace __rcu_is_watching(void)*/ bool notrace rcu_is_watching(void) { -int ret; +bool ret;preempt_disable (); ret =__rcu_is_watching ();
Signature · 1 line
1.9.1
PATCH 3/9 rcu: Fix a sparse warning about boost_mutex being non-static
In reply to a message not in the archivefix a sparse warning about boost_mutex being non-static by marking it as static
--- kernel/rcu/rcutorture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/rcutorture.c +1 -1
@@ -182,7 +182,7 @@ static u64 notrace rcu_trace_clock_local(void)#endif /* #else #ifdef CONFIG_RCU_TRACE */ static unsigned long boost_starttime;/* jiffies of next boost test start. */ -DEFINE_MUTEX (boost_mutex);/* protect setting boost_starttime */ +static DEFINE_MUTEX (boost_mutex);/* protect setting boost_starttime */ /* and boost task create/destroy. */ static atomic_t barrier_cbs_count;/* Barrier callbacks registered. */ static bool barrier_phase;/* Test phase. */
Signature · 1 line
1.9.1
PATCH 4/9 rcu: return bool type for rcu_try_advance_all_cbs()
In reply to a message not in the archivereturn a bool type instead of 0 in rcu_try_advance_all_cbs()
--- kernel/rcu/tree_plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/tree_plugin.h +1 -1
@@ -1625,7 +1625,7 @@ static bool __maybe_unused rcu_try_advance_all_cbs(void)/* Exit early if we advanced recently. */ if (jiffies == rdtp->last_advance_all) -return 0 ; +return false; rdtp->last_advance_all = jiffies;for_each_rcu_flavor (rsp) {
Signature · 1 line
1.9.1
PATCH 5/9 rcu: use true/false for return in __call_rcu_nocb()
In reply to a message not in the archivereturn true/false instead of 0/1 in __call_rcu_nocb() as this returns a bool type
--- kernel/rcu/tree_plugin.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/rcu/tree_plugin.h +2 -2
@@ -2132,7 +2132,7 @@ static bool __call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *rhp, {if (!rcu_is_nocb_cpu (rdp->cpu)) -return 0 ; +return false;__call_rcu_nocb_enqueue (rdp, rhp, &rhp->next,1 , lazy, flags);if (__is_kfree_rcu_offset ((unsigned long )rhp->func)) trace_rcu_kfree_callback(rdp->rsp->name, rhp,
@@ -2143,7 +2143,7 @@ static bool __call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *rhp,trace_rcu_callback (rdp->rsp->name, rhp, -atomic_long_read (&rdp->nocb_q_count_lazy), -atomic_long_read (&rdp->nocb_q_count)); -return 1 ; +return true; }/*
Signature · 1 line
1.9.1
PATCH 6/9 rcu: use true/false for return in rcu_nocb_adopt_orphan_cbs()
In reply to a message not in the archivereturn true/false in rcu_nocb_adopt_orphan_cbs() instead of 0/1 as this function has return type of bool
--- kernel/rcu/tree_plugin.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/rcu/tree_plugin.h +2 -2
@@ -2159,7 +2159,7 @@ static bool __maybe_unused rcu_nocb_adopt_orphan_cbs(struct rcu_state *rsp,/* If this is not a no-CBs CPU, tell the caller to do it the old way. */ if (!rcu_is_nocb_cpu (smp_processor_id ())) -return 0 ; +return false; rsp->qlen =0 ; rsp->qlen_lazy =0 ;
@@ -2178,7 +2178,7 @@ static bool __maybe_unused rcu_nocb_adopt_orphan_cbs(struct rcu_state *rsp, rsp->orphan_nxtlist =NULL ; rsp->orphan_nxttail = &rsp->orphan_nxtlist; } -return 1 ; +return true; }/*
Signature · 1 line
1.9.1
PATCH 7/9 rcu: use false for return in __call_rcu_nocb()
In reply to a message not in the archivereturn false instead of 0 in __call_rcu_nocb() as this has bool as return type
--- kernel/rcu/tree_plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/tree_plugin.h +1 -1
@@ -2382,7 +2382,7 @@ static void rcu_init_one_nocb(struct rcu_node *rnp)static bool __call_rcu_nocb (struct rcu_data *rdp,struct rcu_head *rhp,bool lazy,unsigned long flags) { -return 0 ; +return false; } static bool __maybe_unused rcu_nocb_adopt_orphan_cbs(struct rcu_state *rsp,
Signature · 1 line
1.9.1
PATCH 8/9 rcu: return false instead of 0 in rcu_nocb_adopt_orphan_cbs()
In reply to a message not in the archivereturn false instead of 0 in rcu_nocb_adopt_orphan_cbs() as this has bool as return type
--- kernel/rcu/tree_plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/tree_plugin.h +1 -1
@@ -2389,7 +2389,7 @@ static bool __maybe_unused rcu_nocb_adopt_orphan_cbs(struct rcu_state *rsp, struct rcu_data *rdp, unsigned long flags) { -return 0 ; +return false; }static void __init rcu_boot_init_nocb_percpu_data (struct rcu_data *rdp)
Signature · 1 line
1.9.1
PATCH 9/9 rcu: return bool type in rcu_lockdep_current_cpu_online()
In reply to a message not in the archivereturn true instead of 1 in rcu_lockdep_current_cpu_online() as this has bool as return type
--- include/linux/rcupdate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/rcupdate.h +1 -1
@@ -349,7 +349,7 @@ bool rcu_lockdep_current_cpu_online(void);#else /* #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) */ static inline bool rcu_lockdep_current_cpu_online (void ) { -return 1 ; +return true; }#endif /* #else #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) */
Signature · 1 line
1.9.1
Re: [PATCH 0/9] rcu: trivial sparse and return type fixes for rcu
In reply to a message not in the archiveThis patch series contains trivial fixes for sparse warnings and using bool types where appropriate instead of 0/1.
I can probably merge the return type changes into one commit if you think that is appropriate.
Pranith Kumar (9):
rcu: fix sparse warning about rcu_batches_completed_preempt(
) being
non-static
rcu: use bool type for return value in rcu_is_watching()
rcu: Fix a sparse warning about boost_mutex being non-static
rcu: return bool type in rcu_lockdep_current_cpu_online()
rcu: return bool type for rcu_try_advance_all_cbs()
rcu: use true/false for return in __call_rcu_nocb()
rcu: use true/false for return in rcu_nocb_adopt_orphan_cbs()
rcu: use false for return in __call_rcu_nocb()
rcu: use bool return type in rcu_nocb_adopt_orphan_cbs()
include/linux/rcupdate.h | 2 +- kernel/rcu/rcutorture.c | 2 +- kernel/rcu/tree.c | 2 +- kernel/rcu/tree_plugin.h | 16 ++++++++-------- 4 files changed, 11 insertions(+), 11 deletions(-)
Re: [PATCH 0/9] rcu: trivial sparse and return type fixes for rcu
Quoted 5 lines · Pranith Kumar
This patch series contains trivial fixes for sparse warnings and using bool types where appropriate instead of 0/1.
I can probably merge the return type changes into one commit if you think that is appropriate.
Queued for 3.18, with the exception of 3/9, which I fixed up and queued the earlier version. I guess I should have waited a few minutes longer. ;-)
Thanx, Paul
Quoted 19 lines
Pranith Kumar (9):
rcu: fix sparse warning about rcu_batches_completed_preempt(
) being
non-static
rcu: use bool type for return value inrcu_is_watching()
rcu: Fix a sparse warning aboutboost_mutexbeing non-static
rcu: return bool type inrcu_lockdep_current_cpu_online()
rcu: return bool type forrcu_try_advance_all_cbs()
rcu: use true/false for return in__call_rcu_nocb()
rcu: use true/false for return inrcu_nocb_adopt_orphan_cbs()
rcu: use false for return in__call_rcu_nocb()
rcu: use bool return type inrcu_nocb_adopt_orphan_cbs()include/linux/rcupdate.h | 2 +- kernel/rcu/rcutorture.c | 2 +- kernel/rcu/tree.c | 2 +- kernel/rcu/tree_plugin.h | 16 ++++++++-------- 4 files changed, 11 insertions(+), 11 deletions(-)