Commit 0789e13
bpf: Explicitly size compatible_reg_types
Arrays with designated initializers have an implicit length of the highest initialized value plus one. I used this to ensure that newly added entries in enum bpf_reg_type get a NULL entry in compatible_reg_types. This is difficult to understand since it requires knowledge of the peculiarities of designated initializers. Use __BPF_ARG_TYPE_MAX to size the array instead. Suggested-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Lorenz Bauer <lmb@cloudflare.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Andrii Nakryiko <andriin@fb.com> Link: https://lore.kernel.org/bpf/20200923160156.80814-1-lmb@cloudflare.com1 parent a8a7179 commit 0789e13
1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4002 | 4002 | | |
4003 | 4003 | | |
4004 | 4004 | | |
4005 | | - | |
| 4005 | + | |
4006 | 4006 | | |
4007 | 4007 | | |
4008 | 4008 | | |
| |||
4025 | 4025 | | |
4026 | 4026 | | |
4027 | 4027 | | |
4028 | | - | |
4029 | 4028 | | |
4030 | 4029 | | |
4031 | 4030 | | |
| |||
0 commit comments