bpf: fix sysctl.c warning
Subsystems (5)
PATCH 1/1 bpf: fix sysctl.c warning
When CONFIG_BPF_SYSCALL or CONFIG_SYSCTL is disabled, we get a warning about an unused function:
kernel/sysctl.c:3331:12: error: 'proc_dointvec_minmax_bpf_stats' defined but not used [-Werror=unused-function]
static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write,
The CONFIG_BPF_SYSCALL check was already handled, but the SYSCTL check is needed on top.
--- kernel/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sysctl.c +1 -1
@@ -3330,7 +3330,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,#endif /* CONFIG_PROC_SYSCTL */ -#ifdef CONFIG_BPF_SYSCALL +#if defined(CONFIG_BPF_SYSCALL ) && defined(CONFIG_SYSCTL )static int proc_dointvec_minmax_bpf_stats (struct ctl_table *table,int write,void __user *buffer,size_t *lenp,loff_t *ppos)
Signature · 1 line
2.20.0
Quoted 4 lines · Arnd Bergmann
When
CONFIG_BPF_SYSCALLorCONFIG_SYSCTLis disabled, we get a warning about an unused function:
Quoted 8 lines
kernel/sysctl.c:3331:12: error: 'proc_dointvec_minmax_bpf_stats' defined but not used [-Werror=unused-function]
static int proc_dointvec_minmax_bpf_stats(structctl_table*table, int write,The
CONFIG_BPF_SYSCALLcheck was already handled, but the SYSCTL check is needed on top.Fixes 492ecee892c2 ("bpf: enable program stats")Signed-off-by Arnd Bergmann <[email protected]>
-Kees
Quoted 20 lines
--- kernel/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/sysctl.c +1
-2@@ -3330,7 +3330,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,#endif /* CONFIG_PROC_SYSCTL */ -#ifdef CONFIG_BPF_SYSCALL +#if defined(CONFIG_BPF_SYSCALL ) && defined(CONFIG_SYSCTL )static int proc_dointvec_minmax_bpf_stats (struct ctl_table *table,int write,void __user *buffer,size_t *lenp,loff_t *ppos) --2.20.0
Signature · 1 line
Kees Cook
Quoted 11 lines · Arnd Bergmann
When
CONFIG_BPF_SYSCALLorCONFIG_SYSCTLis disabled, we get a warning about an unused function:
kernel/sysctl.c:3331:12: error: 'proc_dointvec_minmax_bpf_stats' defined but not used [-Werror=unused-function]
static int proc_dointvec_minmax_bpf_stats(structctl_table*table, int write,The
CONFIG_BPF_SYSCALLcheck was already handled, but the SYSCTL check is needed on top.Fixes 492ecee892c2 ("bpf: enable program stats")Signed-off-by Arnd Bergmann <[email protected]>
Quoted 20 lines
--- kernel/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/sysctl.c +1
-1@@ -3330,7 +3330,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,#endif /* CONFIG_PROC_SYSCTL */ -#ifdef CONFIG_BPF_SYSCALL +#if defined(CONFIG_BPF_SYSCALL ) && defined(CONFIG_SYSCTL )static int proc_dointvec_minmax_bpf_stats (struct ctl_table *table,int write,void __user *buffer,size_t *lenp,loff_t *ppos)Signature · 1 line
2.20.0
Song Liu
Acked-byQuoted 11 lines · Christian Brauner
Quoted 6 lines · Arnd Bergmann
When
CONFIG_BPF_SYSCALLorCONFIG_SYSCTLis disabled, we get a warning about an unused function:
kernel/sysctl.c:3331:12: error: 'proc_dointvec_minmax_bpf_stats' defined but not used [-Werror=unused-function] static int proc_dointvec_minmax_bpf_stats(structctl_table*table, int write,
Quoted 7 lines
Quoted 5 lines
The
CONFIG_BPF_SYSCALLcheck was already handled, but the SYSCTL check is needed on top.Fixes 492ecee892c2 ("bpf: enable program stats")Signed-off-by Arnd Bergmann <[email protected]>Reviewed-by Christian Brauner <[email protected]>
Quoted 21 lines
Quoted 21 lines
---
kernel/sysctl.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)kernel/sysctl.c +1
-1@@ -3330,7 +3330,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,#endif /* CONFIG_PROC_SYSCTL */ -#ifdef CONFIG_BPF_SYSCALL +#if defined(CONFIG_BPF_SYSCALL ) && defined(CONFIG_SYSCTL )static int proc_dointvec_minmax_bpf_stats (struct ctl_table *table,int write,void __user *buffer,size_t *lenp,loff_t *ppos)Signature · 1 line
2.20.0
Quoted 11 lines · Arnd Bergmann
When
CONFIG_BPF_SYSCALLorCONFIG_SYSCTLis disabled, we get a warning about an unused function:
kernel/sysctl.c:3331:12: error: 'proc_dointvec_minmax_bpf_stats' defined but not used [-Werror=unused-function]
static int proc_dointvec_minmax_bpf_stats(structctl_table*table, int write,The
CONFIG_BPF_SYSCALLcheck was already handled, but the SYSCTL check is needed on top.Fixes 492ecee892c2 ("bpf: enable program stats")Signed-off-by Arnd Bergmann <[email protected]>
Applied, thanks!