Skip to contentSkip to conversation

locking/static_keys: Make some symbols static

PATCH New Bixuan Cui 1 participant 1 message May 8, 2021

Subsystems (2)
lore
Share & tools
lore

Bixuan Cui

author
#0 lore raw

PATCH 1/1 locking/static_keys: Make some symbols static

The sparse tool complains as follows:

lib/test_static_keys.c:15:19: warning:
symbol 'old_true_key' was not declared. Should it be static?
lib/test_static_keys.c:16:19: warning:
symbol 'old_false_key' was not declared. Should it be static?
lib/test_static_keys.c:19:1: warning:
symbol 'true_key' was not declared. Should it be static?
lib/test_static_keys.c:20:1: warning:
symbol 'false_key' was not declared. Should it be static?

This symbol is not used outside of test_static_keys.c, so this commit marks it static.

---
 lib/test_static_keys.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
lib/test_static_keys.c +4 -4
index 42daa74be029..17a185312097 100644
@@ -12,12 +12,12 @@
 #include <linux/jump_label.h>
 
 /* old keys */
-struct static_key old_true_key	= STATIC_KEY_INIT_TRUE;
-struct static_key old_false_key	= STATIC_KEY_INIT_FALSE;
+static struct static_key old_true_key	= STATIC_KEY_INIT_TRUE;
+static struct static_key old_false_key	= STATIC_KEY_INIT_FALSE;
 
 /* new api */
-DEFINE_STATIC_KEY_TRUE(true_key);
-DEFINE_STATIC_KEY_FALSE(false_key);
+static DEFINE_STATIC_KEY_TRUE(true_key);
+static DEFINE_STATIC_KEY_FALSE(false_key);
 
 /* external */
 extern struct static_key base_old_true_key;