Re: [PATCH v11 bpf-next 4/8] libbpf: Add layout encoding support
Alexei Starovoitov <[email protected]>
| Newsgroups | org.kernel.vger.dwarves,org.kernel.vger.bpf |
|---|---|
| Message-ID | <CAADnVQLSndJcV1wdBLZ8NP5_-do4cyJeQEGG+o03mJh3tPWi7A@mail.gmail.com> |
On Mon, Mar 2, 2026 at 4:18 AM <[email protected]> wrote: > > > diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c > > index 9f4d1bd73b4d..e87003711543 100644 > > --- a/tools/lib/bpf/btf.c > > +++ b/tools/lib/bpf/btf.c > > [ ... ] > > > @@ -1186,12 +1229,26 @@ static struct btf *btf_new_empty(struct btf *base_btf) > > > > struct btf *btf__new_empty(void) > > { > > - return libbpf_ptr(btf_new_empty(NULL)); > > + LIBBPF_OPTS(btf_new_opts, opts); > > + > > + return libbpf_ptr(btf_new_empty(&opts)); > > } > > This isn't a bug, but Eduard Zingerman noted in v8 review that > btf_new_empty(NULL) should work fine because OPTS_GET already > handles NULL opts by returning default values. The LIBBPF_OPTS > wrapper could be simplified back to just passing NULL here. > > https://lore.kernel.org/bpf/[email protected]/ Agree with Eduard here. Why change it? Also AI review on patch 6 makes sense too. Pls respin. pw-bot: cr