[PATCH -next] locking/static_keys: Make some symbols static
From: Bixuan Cui
Date: Fri May 07 2021 - 21:51:36 EST
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.
Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
Signed-off-by: Bixuan Cui <cuibixuan@xxxxxxxxxx>
---
lib/test_static_keys.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/test_static_keys.c b/lib/test_static_keys.c
index 42daa74be029..17a185312097 100644
--- a/lib/test_static_keys.c
+++ b/lib/test_static_keys.c
@@ -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;