Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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")
Signed-off-by: Chen Jiahao <chenjiahao16@huawei.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

authored by

Chen Jiahao and committed by
Luis Chamberlain
4b49df65 b9080468

+1 -1
+1 -1
samples/hw_breakpoint/data_breakpoint.c
··· 21 21 #include <linux/perf_event.h> 22 22 #include <linux/hw_breakpoint.h> 23 23 24 - struct perf_event * __percpu *sample_hbp; 24 + static struct perf_event * __percpu *sample_hbp; 25 25 26 26 static char ksym_name[KSYM_NAME_LEN] = "jiffies"; 27 27 module_param_string(ksym, ksym_name, KSYM_NAME_LEN, S_IRUGO);