linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/9] rcu: fix sparse warning about rcu_batches_completed_preempt() being non-static
       [not found] <1404858378-23806-1-git-send-email-bobby.prani@gmail.com>
@ 2014-07-08 22:26 ` Pranith Kumar
  2014-07-08 22:26 ` [PATCH 2/9] rcu: use bool type for return value in rcu_is_watching() Pranith Kumar
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Pranith Kumar @ 2014-07-08 22:26 UTC (permalink / raw)
  To: Paul E. McKenney, Josh Triplett, open list:READ-COPY UPDATE...

fix sparse warning about rcu_batches_completed_preempt() being non-static by
marking it as static

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 kernel/rcu/tree_plugin.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 637a8a9..1a4ab26 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -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;
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/9] rcu: use bool type for return value in rcu_is_watching()
       [not found] <1404858378-23806-1-git-send-email-bobby.prani@gmail.com>
  2014-07-08 22:26 ` [PATCH 1/9] rcu: fix sparse warning about rcu_batches_completed_preempt() being non-static Pranith Kumar
@ 2014-07-08 22:26 ` Pranith Kumar
  2014-07-08 22:26 ` [PATCH 3/9] rcu: Fix a sparse warning about boost_mutex being non-static Pranith Kumar
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Pranith Kumar @ 2014-07-08 22:26 UTC (permalink / raw)
  To: Paul E. McKenney, Josh Triplett, open list:READ-COPY UPDATE...

use a bool type for return in rcu_is_watching()

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 kernel/rcu/tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index dac6d20..dff3d5b 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -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();
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/9] rcu: Fix a sparse warning about boost_mutex being non-static
       [not found] <1404858378-23806-1-git-send-email-bobby.prani@gmail.com>
  2014-07-08 22:26 ` [PATCH 1/9] rcu: fix sparse warning about rcu_batches_completed_preempt() being non-static Pranith Kumar
  2014-07-08 22:26 ` [PATCH 2/9] rcu: use bool type for return value in rcu_is_watching() Pranith Kumar
@ 2014-07-08 22:26 ` Pranith Kumar
  2014-07-08 22:26 ` [PATCH 4/9] rcu: return bool type for rcu_try_advance_all_cbs() Pranith Kumar
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Pranith Kumar @ 2014-07-08 22:26 UTC (permalink / raw)
  To: Paul E. McKenney, Josh Triplett, open list:READ-COPY UPDATE...

fix a sparse warning about boost_mutex being non-static by marking it as static

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 kernel/rcu/rcutorture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 7fa34f8..5ec0452 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -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. */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/9] rcu: return bool type for rcu_try_advance_all_cbs()
       [not found] <1404858378-23806-1-git-send-email-bobby.prani@gmail.com>
                   ` (2 preceding siblings ...)
  2014-07-08 22:26 ` [PATCH 3/9] rcu: Fix a sparse warning about boost_mutex being non-static Pranith Kumar
@ 2014-07-08 22:26 ` Pranith Kumar
  2014-07-08 22:26 ` [PATCH 5/9] rcu: use true/false for return in __call_rcu_nocb() Pranith Kumar
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Pranith Kumar @ 2014-07-08 22:26 UTC (permalink / raw)
  To: Paul E. McKenney, Josh Triplett, open list:READ-COPY UPDATE...

return a bool type instead of 0 in rcu_try_advance_all_cbs()

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 kernel/rcu/tree_plugin.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 1a4ab26..6c1feee 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -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) {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/9] rcu: use true/false for return in __call_rcu_nocb()
       [not found] <1404858378-23806-1-git-send-email-bobby.prani@gmail.com>
                   ` (3 preceding siblings ...)
  2014-07-08 22:26 ` [PATCH 4/9] rcu: return bool type for rcu_try_advance_all_cbs() Pranith Kumar
@ 2014-07-08 22:26 ` Pranith Kumar
  2014-07-08 22:26 ` [PATCH 6/9] rcu: use true/false for return in rcu_nocb_adopt_orphan_cbs() Pranith Kumar
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Pranith Kumar @ 2014-07-08 22:26 UTC (permalink / raw)
  To: Paul E. McKenney, Josh Triplett, open list:READ-COPY UPDATE...

return true/false instead of 0/1 in __call_rcu_nocb() as this returns a bool type

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 kernel/rcu/tree_plugin.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 6c1feee..9f119f4 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -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;
 }
 
 /*
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 6/9] rcu: use true/false for return in rcu_nocb_adopt_orphan_cbs()
       [not found] <1404858378-23806-1-git-send-email-bobby.prani@gmail.com>
                   ` (4 preceding siblings ...)
  2014-07-08 22:26 ` [PATCH 5/9] rcu: use true/false for return in __call_rcu_nocb() Pranith Kumar
@ 2014-07-08 22:26 ` Pranith Kumar
  2014-07-08 22:26 ` [PATCH 7/9] rcu: use false for return in __call_rcu_nocb() Pranith Kumar
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Pranith Kumar @ 2014-07-08 22:26 UTC (permalink / raw)
  To: Paul E. McKenney, Josh Triplett, open list:READ-COPY UPDATE...

return true/false in rcu_nocb_adopt_orphan_cbs() instead of 0/1 as this function
has return type of bool

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 kernel/rcu/tree_plugin.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 9f119f4..86a3565 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -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;
 }
 
 /*
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 7/9] rcu: use false for return in __call_rcu_nocb()
       [not found] <1404858378-23806-1-git-send-email-bobby.prani@gmail.com>
                   ` (5 preceding siblings ...)
  2014-07-08 22:26 ` [PATCH 6/9] rcu: use true/false for return in rcu_nocb_adopt_orphan_cbs() Pranith Kumar
@ 2014-07-08 22:26 ` Pranith Kumar
  2014-07-08 22:26 ` [PATCH 8/9] rcu: return false instead of 0 in rcu_nocb_adopt_orphan_cbs() Pranith Kumar
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Pranith Kumar @ 2014-07-08 22:26 UTC (permalink / raw)
  To: Paul E. McKenney, Josh Triplett, open list:READ-COPY UPDATE...

return false instead of 0 in __call_rcu_nocb() as this has bool as return type

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 kernel/rcu/tree_plugin.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 86a3565..5c21f4b 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 8/9] rcu: return false instead of 0 in rcu_nocb_adopt_orphan_cbs()
       [not found] <1404858378-23806-1-git-send-email-bobby.prani@gmail.com>
                   ` (6 preceding siblings ...)
  2014-07-08 22:26 ` [PATCH 7/9] rcu: use false for return in __call_rcu_nocb() Pranith Kumar
@ 2014-07-08 22:26 ` Pranith Kumar
  2014-07-08 22:26 ` [PATCH 9/9] rcu: return bool type in rcu_lockdep_current_cpu_online() Pranith Kumar
  2014-07-08 22:32 ` [PATCH 0/9] rcu: trivial sparse and return type fixes for rcu Pranith Kumar
  9 siblings, 0 replies; 11+ messages in thread
From: Pranith Kumar @ 2014-07-08 22:26 UTC (permalink / raw)
  To: Paul E. McKenney, Josh Triplett, open list:READ-COPY UPDATE...

return false instead of 0 in rcu_nocb_adopt_orphan_cbs() as this has bool as return type

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 kernel/rcu/tree_plugin.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 5c21f4b..9a4dc07 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -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)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 9/9] rcu: return bool type in rcu_lockdep_current_cpu_online()
       [not found] <1404858378-23806-1-git-send-email-bobby.prani@gmail.com>
                   ` (7 preceding siblings ...)
  2014-07-08 22:26 ` [PATCH 8/9] rcu: return false instead of 0 in rcu_nocb_adopt_orphan_cbs() Pranith Kumar
@ 2014-07-08 22:26 ` Pranith Kumar
  2014-07-08 22:32 ` [PATCH 0/9] rcu: trivial sparse and return type fixes for rcu Pranith Kumar
  9 siblings, 0 replies; 11+ messages in thread
From: Pranith Kumar @ 2014-07-08 22:26 UTC (permalink / raw)
  To: Paul E. McKenney, Josh Triplett, open list:READ-COPY UPDATE...

return true instead of 1 in rcu_lockdep_current_cpu_online() as this has bool as return type

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 include/linux/rcupdate.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index e8c55d8..2ed25c6 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -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) */
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/9] rcu: trivial sparse and return type fixes for rcu
       [not found] <1404858378-23806-1-git-send-email-bobby.prani@gmail.com>
                   ` (8 preceding siblings ...)
  2014-07-08 22:26 ` [PATCH 9/9] rcu: return bool type in rcu_lockdep_current_cpu_online() Pranith Kumar
@ 2014-07-08 22:32 ` Pranith Kumar
  2014-07-08 22:48   ` Paul E. McKenney
  9 siblings, 1 reply; 11+ messages in thread
From: Pranith Kumar @ 2014-07-08 22:32 UTC (permalink / raw)
  To: LKML, Paul McKenney, Josh Triplett

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.

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(-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/9] rcu: trivial sparse and return type fixes for rcu
  2014-07-08 22:32 ` [PATCH 0/9] rcu: trivial sparse and return type fixes for rcu Pranith Kumar
@ 2014-07-08 22:48   ` Paul E. McKenney
  0 siblings, 0 replies; 11+ messages in thread
From: Paul E. McKenney @ 2014-07-08 22:48 UTC (permalink / raw)
  To: Pranith Kumar; +Cc: LKML, Josh Triplett

On Tue, Jul 08, 2014 at 06:32:03PM -0400, Pranith Kumar wrote:
> 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

> 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(-)
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-07-08 22:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1404858378-23806-1-git-send-email-bobby.prani@gmail.com>
2014-07-08 22:26 ` [PATCH 1/9] rcu: fix sparse warning about rcu_batches_completed_preempt() being non-static Pranith Kumar
2014-07-08 22:26 ` [PATCH 2/9] rcu: use bool type for return value in rcu_is_watching() Pranith Kumar
2014-07-08 22:26 ` [PATCH 3/9] rcu: Fix a sparse warning about boost_mutex being non-static Pranith Kumar
2014-07-08 22:26 ` [PATCH 4/9] rcu: return bool type for rcu_try_advance_all_cbs() Pranith Kumar
2014-07-08 22:26 ` [PATCH 5/9] rcu: use true/false for return in __call_rcu_nocb() Pranith Kumar
2014-07-08 22:26 ` [PATCH 6/9] rcu: use true/false for return in rcu_nocb_adopt_orphan_cbs() Pranith Kumar
2014-07-08 22:26 ` [PATCH 7/9] rcu: use false for return in __call_rcu_nocb() Pranith Kumar
2014-07-08 22:26 ` [PATCH 8/9] rcu: return false instead of 0 in rcu_nocb_adopt_orphan_cbs() Pranith Kumar
2014-07-08 22:26 ` [PATCH 9/9] rcu: return bool type in rcu_lockdep_current_cpu_online() Pranith Kumar
2014-07-08 22:32 ` [PATCH 0/9] rcu: trivial sparse and return type fixes for rcu Pranith Kumar
2014-07-08 22:48   ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).