samples/hw_breakpoint: mark sample_hbp as static
authorChen Jiahao <chenjiahao16@huawei.com>
Wed, 26 Jul 2023 10:17:59 +0000 (10:17 +0000)
committerLuis Chamberlain <mcgrof@kernel.org>
Wed, 26 Jul 2023 18:17:19 +0000 (11:17 -0700)
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")
Signed-off-by: Chen Jiahao <chenjiahao16@huawei.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
samples/hw_breakpoint/data_breakpoint.c

index b99322f..a2c831e 100644 (file)
@@ -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);