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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 23, 2020 at 9:05 AM Andrii Nakryiko
<andrii.nakryiko@xxxxxxxxx> wrote:
>
> On Wed, Sep 23, 2020 at 9:03 AM Lorenz Bauer <lmb@xxxxxxxxxxxxxx> wrote:
> >
> > 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 <lmb@xxxxxxxxxxxxxx>
> > Suggested-by: Alexei Starovoitov <ast@xxxxxxxxxx>
> > ---
>
> I like this more as well.
>
> Acked-by: Andrii Nakryiko <andriin@xxxxxx>

Applied. Thanks



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux