Skip to contentSkip to conversation

locktorture: make function torture_percpu_rwsem_init() static

PATCH Applied Wei Yongjun 2 participants 2 messages Jul 3, 2020 – Jul 6, 2020 Torture-test modules

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 locktorture: make function torture_percpu_rwsem_init() static

The sparse tool complains as follows:

kernel/locking/locktorture.c:569:6: warning:
symbol 'torture_percpu_rwsem_init' was not declared. Should it be static?

And this function is not used outside of locktorture.c, so this commit marks it static.

---
 kernel/locking/locktorture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/locking/locktorture.c +1 -1
index 9cfa5e89cff7..62d215b2e39f 100644
@@ -566,7 +566,7 @@ static struct lock_torture_ops rwsem_lock_ops = {
 #include <linux/percpu-rwsem.h>
 static struct percpu_rw_semaphore pcpu_rwsem;
 
-void torture_percpu_rwsem_init(void)
+static void torture_percpu_rwsem_init(void)
 {
 	BUG_ON(percpu_init_rwsem(&pcpu_rwsem));
 }
maintainer Applied
#1 lore raw
Quoted 9 lines · Wei Yongjun

The sparse tool complains as follows:

kernel/locking/locktorture.c:569:6: warning:
symbol 'torture_percpu_rwsem_init' was not declared. Should it be static?

And this function is not used outside of locktorture.c, so this commit marks it static.

Applied, thank you!!!

Thanx, Paul

Quoted 18 lines
---
 kernel/locking/locktorture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/locking/locktorture.c +1 -1
index 9cfa5e89cff7..62d215b2e39f 100644
@@ -566,7 +566,7 @@ static struct lock_torture_ops rwsem_lock_ops = {
 #include <linux/percpu-rwsem.h>
 static struct percpu_rw_semaphore pcpu_rwsem;
 
-void torture_percpu_rwsem_init(void)
+static void torture_percpu_rwsem_init(void)
 {
 	BUG_ON(percpu_init_rwsem(&pcpu_rwsem));
 }