Skip to contentSkip to conversation

smp: Make symbol 'csd_bug_count' static

PATCH In review Wei Yongjun 2 participants 2 messages Jul 6, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smp: Make symbol 'csd_bug_count' static

The sparse tool complains as follows

kernel/smp.c:107:10: warning:
symbol 'csd_bug_count' was not declared. Should it be static?

This variable is not used outside of smp.c, s this commit marks it static.

---
 kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/smp.c +1 -1
index 6ec6c9578225..65822c1c3e67 100644
@@ -104,7 +104,7 @@ void __init call_function_init(void)
 }
 
 #define CSD_LOCK_TIMEOUT (5 * 1000ULL) /* Milliseconds. */
-atomic_t csd_bug_count = ATOMIC_INIT(0);
+static atomic_t csd_bug_count = ATOMIC_INIT(0);
 
 /* Record current CSD work for current CPU, NULL to erase. */
 static void csd_lock_record(call_single_data_t *csd)
#1 lore raw
Quoted 10 lines · Wei Yongjun

The sparse tool complains as follows

kernel/smp.c:107:10: warning:
symbol 'csd_bug_count' was not declared. Should it be static?

This variable is not used outside of smp.c, s this commit marks it static.

Good catches, applied both, thank you!

Thanx, Paul

Quoted 18 lines
---
 kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/smp.c +1 -1
index 6ec6c9578225..65822c1c3e67 100644
@@ -104,7 +104,7 @@ void __init call_function_init(void)
 }
 
 #define CSD_LOCK_TIMEOUT (5 * 1000ULL) /* Milliseconds. */
-atomic_t csd_bug_count = ATOMIC_INIT(0);
+static atomic_t csd_bug_count = ATOMIC_INIT(0);
 
 /* Record current CSD work for current CPU, NULL to erase. */
 static void csd_lock_record(call_single_data_t *csd)