]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bpf: fix sysctl.c warning
authorArnd Bergmann <arnd@arndb.de>
Mon, 4 Mar 2019 20:34:12 +0000 (21:34 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 7 Mar 2019 09:28:26 +0000 (10:28 +0100)
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.

Fixes: 492ecee892c2 ("bpf: enable program stats")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Christian Brauner <christian@brauner.io>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/sysctl.c

index 7578e21a711b45c8ecddc86ae280c7965e177cac..2322b12cb4cf4c71e92a85781f2ae13b61f2d3c3 100644 (file)
@@ -3274,7 +3274,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)