History

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.

Alexei Starovoitov committed 6 years ago

Commit ce277091 parent 7c3977d1 file · +1 −0Browse files

Unified · Split

kernel/bpf/btf.c+1−0
@@ -3463,6 +3463,7 @@ enum { · 3462 unmodified lines
3463 __ctx_convert##_id,3463 __ctx_convert##_id,
3464#include <linux/bpf_types.h>3464#include <linux/bpf_types.h>
3465#undef BPF_PROG_TYPE3465#undef BPF_PROG_TYPE
3466 __ctx_convert_unused, /* to avoid empty enum in extreme .config */
3466};3467};
3467static u8 bpf_ctx_convert_map[] = {3468static u8 bpf_ctx_convert_map[] = {
3468#define BPF_PROG_TYPE(_id, _name, prog_ctx_type, kern_ctx_type) \3469#define BPF_PROG_TYPE(_id, _name, prog_ctx_type, kern_ctx_type) \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t