Re: [PATCH] kernel/bpf/syscall: fix warning defined but not used

From: Daniel Borkmann
Date: Wed Apr 04 2018 - 05:15:37 EST


On 04/03/2018 02:09 PM, Anders Roxell wrote:
> There will be a build warning -Wunused-function if CONFIG_CGROUP_BPF
> isn't defined, since the only user is inside #ifdef CONFIG_CGROUP_BPF:
> kernel/bpf/syscall.c:1229:12: warning: âbpf_prog_attach_check_attach_typeâ
> defined but not used [-Wunused-function]
> static int bpf_prog_attach_check_attach_type(const struct bpf_prog *prog,
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Current code moves function bpf_prog_attach_check_attach_type inside
> ifdef CONFIG_CGROUP_BPF.
>
> Fixes: 5e43f899b03a ("bpf: Check attach type at prog load time")
> Signed-off-by: Anders Roxell <anders.roxell@xxxxxxxxxx>

Applied to bpf tree, thanks Anders!