Skip to content

Commit ce27709

Browse files
Alexei Starovoitovborkmann
Alexei Starovoitov
authored andcommitted
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 <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Randy Dunlap <[email protected]> # build-tested Link: https://lore.kernel.org/bpf/[email protected]
1 parent 7c3977d commit ce27709

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/bpf/btf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3463,6 +3463,7 @@ enum {
34633463
__ctx_convert##_id,
34643464
#include <linux/bpf_types.h>
34653465
#undef BPF_PROG_TYPE
3466+
__ctx_convert_unused, /* to avoid empty enum in extreme .config */
34663467
};
34673468
static u8 bpf_ctx_convert_map[] = {
34683469
#define BPF_PROG_TYPE(_id, _name, prog_ctx_type, kern_ctx_type) \

0 commit comments

Comments
 (0)