Skip to contentSkip to conversation

samples/hw_breakpoint: mark sample_hbp as static

PATCH Applied Chen Jiahao 2 participants 2 messages Jul 26, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 samples/hw_breakpoint: mark sample_hbp as static

There is a sparse warning shown as below:

samples/hw_breakpoint/data_breakpoint.c:24:19: warning:
symbol 'sample_hbp' was not declared. Should it be static?

Since 'sample_hbp' is only called within data_breakpoint.c, mark it as static to fix the warning.

Fixes 44ee63587dce ("percpu: Add __percpu sparse annotations to hw_breakpoint")
---
 samples/hw_breakpoint/data_breakpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
samples/hw_breakpoint/data_breakpoint.c +1 -1
index 9debd128b2ab..2f64b89f14da 100644
@@ -21,7 +21,7 @@
 #include <linux/perf_event.h>
 #include <linux/hw_breakpoint.h>
 
-struct perf_event * __percpu *sample_hbp;
+static struct perf_event * __percpu *sample_hbp;
 
 static char ksym_name[KSYM_NAME_LEN] = "jiffies";
 module_param_string(ksym, ksym_name, KSYM_NAME_LEN, S_IRUGO);
Signature · 1 line
2.34.1
#1 lore raw
Quoted 10 lines · Chen Jiahao

There is a sparse warning shown as below:

samples/hw_breakpoint/data_breakpoint.c:24:19: warning:
symbol 'sample_hbp' was not declared. Should it be static?

Since 'sample_hbp' is only called within data_breakpoint.c, mark it as static to fix the warning.

Fixes 44ee63587dce ("percpu: Add __percpu sparse annotations to hw_breakpoint")

Thanks, applied and pushed.

Luis