UPSTREAM: 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> Change-Id: Ic0fce80819f2493651d8bf8a6fe8365a43fa1bb1 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 Signed-off-by: Sorayukii <sorayukii69@gmail.com>
This commit is contained in:
parent
a8af29545f
commit
45d21c00a6
1 changed files with 1 additions and 0 deletions
|
|
@ -3469,6 +3469,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) \
|
||||
|
|
|
|||
Loading…
Reference in a new issue