]> git.baikalelectronics.ru Git - kernel.git/commit
kernel/bpf/syscall: fix warning defined but not used
authorAnders Roxell <anders.roxell@linaro.org>
Tue, 3 Apr 2018 12:09:47 +0000 (14:09 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 4 Apr 2018 09:08:36 +0000 (11:08 +0200)
commit2a5b636126fc4b861c7c1673ea288f7f0d506bab
tree24c992d27bcb56eec8b175cbdce7b5c4fa200c32
parent711bf3da5abc26f19d8b93901f1179165c4ceb31
kernel/bpf/syscall: fix warning defined but not used

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: 75c980841d07 ("bpf: Check attach type at prog load time")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/syscall.c