Thread (3 messages) flat view 3 messages, 3 authors, 2020-09-23

Re: [PATCH bpf-next] bpf: explicitly size compatible_reg_types

From: Alexei Starovoitov <hidden>
Date: 2020-09-23 18:49:25
Also in: bpf, lkml

On Wed, Sep 23, 2020 at 9:05 AM Andrii Nakryiko
[off-list ref] wrote:
On Wed, Sep 23, 2020 at 9:03 AM Lorenz Bauer [off-list ref] wrote:
quoted
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.

Signed-off-by: Lorenz Bauer <redacted>
Suggested-by: Alexei Starovoitov <ast@kernel.org>
---
I like this more as well.

Acked-by: Andrii Nakryiko <redacted>
Applied. Thanks
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help