sysctl: Fix unused function warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 5 May 2020 14:07:12 +0000 (16:07 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 5 May 2020 18:59:32 +0000 (11:59 -0700)
commit5447e8e01e101ba19fe5b7551f02d37367156f6b
treec13c56ae37086a6ef504ef8930bd154fdba8c8fd
parent07bf2d97d1f37e7ac8d7be2d84ff108d43556a1d
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.

Fixes: d46edd671a14 ("bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20200505140734.503701-1-arnd@arndb.de
kernel/sysctl.c