diff options
author | Alexei Starovoitov <ast@kernel.org> | 2019-11-28 07:35:08 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-11-29 03:03:42 +0300 |
commit | ce27709b8162e5c501bc54292b8bf6bdecc4bbd4 (patch) | |
tree | f57422083563c11598d5452c46c1f3110e816c6f /kernel | |
parent | 7c3977d1e80401b1a25efded698b05d60ee26e31 (diff) | |
download | linux-ce27709b8162e5c501bc54292b8bf6bdecc4bbd4.tar.xz |
bpf: Fix build in minimal configurations
Some kconfigs can have BPF enabled without a single valid program type.
In such configurations the build will fail with:
./kernel/bpf/btf.c:3466:1: error: empty enum is invalid
Fix it by adding unused value to the enum.
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Link: https://lore.kernel.org/bpf/20191128043508.2346723-1-ast@kernel.org
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/bpf/btf.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index bd5e11881ba3..7d40da240891 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -3463,6 +3463,7 @@ enum { __ctx_convert##_id, #include <linux/bpf_types.h> #undef BPF_PROG_TYPE + __ctx_convert_unused, /* to avoid empty enum in extreme .config */ }; static u8 bpf_ctx_convert_map[] = { #define BPF_PROG_TYPE(_id, _name, prog_ctx_type, kern_ctx_type) \ |