linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] scftorture: Make symbol 'scf_torture_rand' static
@ 2020-07-02 14:47 Wei Yongjun
  2020-07-02 17:02 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2020-07-02 14:47 UTC (permalink / raw)
  To: Hulk Robot, Paul E. McKenney; +Cc: Wei Yongjun, linux-kernel

Fix sparse build warning:

kernel/scftorture.c:124:1: warning:
 symbol '__pcpu_scope_scf_torture_rand' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 kernel/scftorture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/scftorture.c b/kernel/scftorture.c
index 52750c564404..d63d700ad297 100644
--- a/kernel/scftorture.c
+++ b/kernel/scftorture.c
@@ -121,7 +121,7 @@ static unsigned long scf_sel_totweight;
 static atomic_t n_started;
 static atomic_t n_errs;
 
-DEFINE_TORTURE_RANDOM_PERCPU(scf_torture_rand);
+static DEFINE_TORTURE_RANDOM_PERCPU(scf_torture_rand);
 
 // Print torture statistics.  Caller must ensure serialization.
 static void scf_torture_stats_print(void)


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

* Re: [PATCH -next] scftorture: Make symbol 'scf_torture_rand' static
  2020-07-02 14:47 [PATCH -next] scftorture: Make symbol 'scf_torture_rand' static Wei Yongjun
@ 2020-07-02 17:02 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2020-07-02 17:02 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: Hulk Robot, linux-kernel

On Thu, Jul 02, 2020 at 10:47:00PM +0800, Wei Yongjun wrote:
> Fix sparse build warning:
> 
> kernel/scftorture.c:124:1: warning:
>  symbol '__pcpu_scope_scf_torture_rand' was not declared. Should it be static?
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Good catch, applied, thank you!

Due to recent changes, I hand-applied this as shown below.  Please
let me know if I messed anything up.

							Thanx, Paul

------------------------------------------------------------------------

commit ff9210137b0b8d8f045dd1fd116253ba7686e892
Author: Wei Yongjun <weiyongjun1@huawei.com>
Date:   Thu Jul 2 09:56:50 2020 -0700

    scftorture: Make symbol 'scf_torture_rand' static
    
    The sparse tool complains as follows
    
    kernel/scftorture.c:124:1: warning:
     symbol '__pcpu_scope_scf_torture_rand' was not declared. Should it be static?
    
    And this per-CPU variable is not used outside of scftorture.c,
    so this commit marks it static.
    
    Reported-by: Hulk Robot <hulkci@huawei.com>
    Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

diff --git a/kernel/scftorture.c b/kernel/scftorture.c
index 52f74f1..a7fea76 100644
--- a/kernel/scftorture.c
+++ b/kernel/scftorture.c
@@ -134,7 +134,7 @@ static atomic_t n_alloc_errs;
 static bool scfdone;
 static char *bangstr = "";
 
-DEFINE_TORTURE_RANDOM_PERCPU(scf_torture_rand);
+static DEFINE_TORTURE_RANDOM_PERCPU(scf_torture_rand);
 
 // Print torture statistics.  Caller must ensure serialization.
 static void scf_torture_stats_print(void)

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

end of thread, other threads:[~2020-07-02 17:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-02 14:47 [PATCH -next] scftorture: Make symbol 'scf_torture_rand' static Wei Yongjun
2020-07-02 17:02 ` 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).