[PATCH] rcu/rcu_segcblist: fix -Wmissing-prototypes warnings

From: Yi Wang
Date: Sun Oct 20 2019 - 20:14:07 EST


We get these warnings when build kernel W=1:
kernel/rcu/rcu_segcblist.c:91:6: warning: no previous prototype for ârcu_segcblist_set_lenâ [-Wmissing-prototypes]
kernel/rcu/rcu_segcblist.c:107:6: warning: no previous prototype for ârcu_segcblist_add_lenâ [-Wmissing-prototypes]
kernel/rcu/rcu_segcblist.c:137:6: warning: no previous prototype for ârcu_segcblist_xchg_lenâ [-Wmissing-prototypes]

Commit eda669a6a2c5 ("rcu/nocb: Atomic ->len field in rcu_segcblist
structure") introduced this, and make the functions static to fix
them.

Signed-off-by: Yi Wang <wang.yi59@xxxxxxxxxx>
---
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 495c58c..cbc87b8 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);
--
1.8.3.1