sysctl: fix unused function warning
Subsystems (5)
PATCH 1/1 sysctl: fix unused function warning
The newly added bpf_stats_handler function has the wrong #ifdef check around it, leading to an unused-function warning when CONFIG_SYSCTL is disabled:
kernel/sysctl.c:205:12: error: unused function 'bpf_stats_handler' [-Werror,-Wunused-function] static int bpf_stats_handler(struct ctl_table *table, int write,
Fix the check to match the reference.
--- kernel/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sysctl.c +1 -1
@@ -201,7 +201,7 @@ static int max_extfrag_threshold = 1000;#endif /* CONFIG_SYSCTL */ -#ifdef CONFIG_BPF_SYSCALL +#if defined(CONFIG_BPF_SYSCALL ) && defined(CONFIG_SYSCTL )static int bpf_stats_handler (struct ctl_table *table,int write,void __user *buffer,size_t *lenp,loff_t *ppos)
Signature · 1 line
2.26.0
Quoted 11 lines · Arnd Bergmann
The newly added
bpf_stats_handlerfunction has the wrong #ifdef check around it, leading to an unused-function warning whenCONFIG_SYSCTLis disabled:
kernel/sysctl.c:205:12: error: unused function 'bpf_stats_handler' [-Werror,-Wunused-function] static int bpf_stats_handler(structctl_table*table, int write,Fix the check to match the reference.
Fixes d46edd671a14 ("bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS")Signed-off-by Arnd Bergmann <[email protected]>
Quoted 11 lines · Arnd Bergmann
The newly added
bpf_stats_handlerfunction has the wrong #ifdef check around it, leading to an unused-function warning whenCONFIG_SYSCTLis disabled:
kernel/sysctl.c:205:12: error: unused function 'bpf_stats_handler' [-Werror,-Wunused-function] static int bpf_stats_handler(structctl_table*table, int write,Fix the check to match the reference.
Fixes d46edd671a14 ("bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS")Signed-off-by Arnd Bergmann <[email protected]>
Luis
Quoted 8 lines · Arnd Bergmann
The newly added
bpf_stats_handlerfunction has the wrong #ifdef check around it, leading to an unused-function warning whenCONFIG_SYSCTLis disabled:
Quoted 7 lines
kernel/sysctl.c:205:12: error: unused function 'bpf_stats_handler' [-Werror,-Wunused-function] static int bpf_stats_handler(structctl_table*table, int write,Fix the check to match the reference.
Fixes d46edd671a14 ("bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS")Signed-off-by Arnd Bergmann <[email protected]>
Thanks for the fix!
Alexei Starovoitov
AppliedQuoted 12 lines · Song Liu
Quoted 12 lines · Arnd Bergmann
The newly added
bpf_stats_handlerfunction has the wrong #ifdef check around it, leading to an unused-function warning whenCONFIG_SYSCTLis disabled:
kernel/sysctl.c:205:12: error: unused function 'bpf_stats_handler' [-Werror,-Wunused-function] static int bpf_stats_handler(structctl_table*table, int write,
Quoted 8 lines
Quoted 4 lines
Fix the check to match the reference.
Fixes d46edd671a14 ("bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS")Signed-off-by Arnd Bergmann <[email protected]>Acked-by Song Liu <[email protected]>Thanks for the fix!
Applied to bpf-next.
Arnd, please make sure subject includes target tree like [PATCH bpf-next] in the future.
Thanks