* [PATCH] rcu: rcu_segcblist.c make undeclared items static
@ 2019-10-15 10:55 Ben Dooks
2019-10-16 4:05 ` Paul E. McKenney
0 siblings, 1 reply; 2+ messages in thread
From: Ben Dooks @ 2019-10-15 10:55 UTC (permalink / raw)
To: linux-kernel
Cc: Ben Dooks, Paul E. McKenney, Josh Triplett, Steven Rostedt,
Mathieu Desnoyers, Lai Jiangshan, Joel Fernandes, rcu,
linux-kernel
The following are not used outside the unit they are
declared in, so make them static to avoid the following
sparse warnings:
kernel/rcu/rcu_segcblist.c:91:6: warning: symbol 'rcu_segcblist_set_len' was not declared. Should it be static?
kernel/rcu/rcu_segcblist.c:107:6: warning: symbol 'rcu_segcblist_add_len' was not declared. Should it be static?
kernel/rcu/rcu_segcblist.c:137:6: warning: symbol 'rcu_segcblist_xchg_len' was not declared. Should it be static?
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
Cc: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Joel Fernandes <joel@joelfernandes.org>
Cc: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
kernel/rcu/rcu_segcblist.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/rcu/rcu_segcblist.c b/kernel/rcu/rcu_segcblist.c
index 495c58ce1640..cbc87b804db9 100644
--- a/kernel/rcu/rcu_segcblist.c
+++ b/kernel/rcu/rcu_segcblist.c
@@ -88,7 +88,7 @@ struct rcu_head *rcu_cblist_dequeue(struct rcu_cblist *rclp)
}
/* Set the length of an rcu_segcblist structure. */
-void rcu_segcblist_set_len(struct rcu_segcblist *rsclp, long v)
+static void rcu_segcblist_set_len(struct rcu_segcblist *rsclp, long v)
{
#ifdef CONFIG_RCU_NOCB_CPU
atomic_long_set(&rsclp->len, v);
@@ -104,7 +104,7 @@ void rcu_segcblist_set_len(struct rcu_segcblist *rsclp, long v)
* This increase is fully ordered with respect to the callers accesses
* both before and after.
*/
-void rcu_segcblist_add_len(struct rcu_segcblist *rsclp, long v)
+static void rcu_segcblist_add_len(struct rcu_segcblist *rsclp, long v)
{
#ifdef CONFIG_RCU_NOCB_CPU
smp_mb__before_atomic(); /* Up to the caller! */
@@ -134,7 +134,7 @@ void rcu_segcblist_inc_len(struct rcu_segcblist *rsclp)
* with the actual number of callbacks on the structure. This exchange is
* fully ordered with respect to the callers accesses both before and after.
*/
-long rcu_segcblist_xchg_len(struct rcu_segcblist *rsclp, long v)
+static long rcu_segcblist_xchg_len(struct rcu_segcblist *rsclp, long v)
{
#ifdef CONFIG_RCU_NOCB_CPU
return atomic_long_xchg(&rsclp->len, v);
--
2.23.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rcu: rcu_segcblist.c make undeclared items static
2019-10-15 10:55 [PATCH] rcu: rcu_segcblist.c make undeclared items static Ben Dooks
@ 2019-10-16 4:05 ` Paul E. McKenney
0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2019-10-16 4:05 UTC (permalink / raw)
To: Ben Dooks
Cc: linux-kernel, Josh Triplett, Steven Rostedt, Mathieu Desnoyers,
Lai Jiangshan, Joel Fernandes, rcu, linux-kernel
On Tue, Oct 15, 2019 at 11:55:24AM +0100, Ben Dooks wrote:
> The following are not used outside the unit they are
> declared in, so make them static to avoid the following
> sparse warnings:
>
> kernel/rcu/rcu_segcblist.c:91:6: warning: symbol 'rcu_segcblist_set_len' was not declared. Should it be static?
> kernel/rcu/rcu_segcblist.c:107:6: warning: symbol 'rcu_segcblist_add_len' was not declared. Should it be static?
> kernel/rcu/rcu_segcblist.c:137:6: warning: symbol 'rcu_segcblist_xchg_len' was not declared. Should it be static?
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Good catch, but commit 292d1bb2 ("rcu: Several rcu_segcblist functions
can be static") beat you to it by a month or two. This commit is still
in -rcu, but will be part of my pull request in a couple of weeks.
See -rcu branch "dev":
git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
Thanx, Paul
> ---
> Cc: "Paul E. McKenney" <paulmck@kernel.org>
> Cc: Josh Triplett <josh@joshtriplett.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Cc: Lai Jiangshan <jiangshanlai@gmail.com>
> Cc: Joel Fernandes <joel@joelfernandes.org>
> Cc: rcu@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
> kernel/rcu/rcu_segcblist.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/rcu/rcu_segcblist.c b/kernel/rcu/rcu_segcblist.c
> index 495c58ce1640..cbc87b804db9 100644
> --- a/kernel/rcu/rcu_segcblist.c
> +++ b/kernel/rcu/rcu_segcblist.c
> @@ -88,7 +88,7 @@ struct rcu_head *rcu_cblist_dequeue(struct rcu_cblist *rclp)
> }
>
> /* Set the length of an rcu_segcblist structure. */
> -void rcu_segcblist_set_len(struct rcu_segcblist *rsclp, long v)
> +static void rcu_segcblist_set_len(struct rcu_segcblist *rsclp, long v)
> {
> #ifdef CONFIG_RCU_NOCB_CPU
> atomic_long_set(&rsclp->len, v);
> @@ -104,7 +104,7 @@ void rcu_segcblist_set_len(struct rcu_segcblist *rsclp, long v)
> * This increase is fully ordered with respect to the callers accesses
> * both before and after.
> */
> -void rcu_segcblist_add_len(struct rcu_segcblist *rsclp, long v)
> +static void rcu_segcblist_add_len(struct rcu_segcblist *rsclp, long v)
> {
> #ifdef CONFIG_RCU_NOCB_CPU
> smp_mb__before_atomic(); /* Up to the caller! */
> @@ -134,7 +134,7 @@ void rcu_segcblist_inc_len(struct rcu_segcblist *rsclp)
> * with the actual number of callbacks on the structure. This exchange is
> * fully ordered with respect to the callers accesses both before and after.
> */
> -long rcu_segcblist_xchg_len(struct rcu_segcblist *rsclp, long v)
> +static long rcu_segcblist_xchg_len(struct rcu_segcblist *rsclp, long v)
> {
> #ifdef CONFIG_RCU_NOCB_CPU
> return atomic_long_xchg(&rsclp->len, v);
> --
> 2.23.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-16 4:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-15 10:55 [PATCH] rcu: rcu_segcblist.c make undeclared items static Ben Dooks
2019-10-16 4:05 ` 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).