BPF List
 help / color / mirror / Atom feed
From: Yuntao Wang <ytcoode@gmail.com>
To: andrii.nakryiko@gmail.com
Cc: andrii@kernel.org, ast@kernel.org, bpf@vger.kernel.org,
	daniel@iogearbox.net, john.fastabend@gmail.com, kafai@fb.com,
	kpsingh@kernel.org, songliubraving@fb.com, yhs@fb.com,
	ytcoode@gmail.com
Subject: Re: [PATCH bpf-next] libbpf: Remove redundant check in btf_fixup_datasec()
Date: Tue, 22 Feb 2022 00:22:50 +0800	[thread overview]
Message-ID: <20220221162250.245059-1-ytcoode@gmail.com> (raw)
In-Reply-To: <CAEf4BzYYvHBbTKySwy-G9WttuWL1SD=S7RM=D39K8nfd-A_wCQ@mail.gmail.com>

On Sun, Feb 20, 2022 at 12:19 PM Andrii Nakryiko
<andrii.nakryiko@gmail.com> wrote:
>
> On Sun, Feb 20, 2022 at 12:15 PM Andrii Nakryiko
> <andrii.nakryiko@gmail.com> wrote:
>
> > On Sat, Feb 19, 2022 at 11:29 PM Yuntao Wang <ytcoode@gmail.com> wrote:
> > >
> > > The check 't->size && t->size != size' is redundant because if t->size
> > > compares unequal to 0, we will just skip straight to sorting variables.
> > >
> > > Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
> > > ---
> > >  tools/lib/bpf/libbpf.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> > > index ad43b6ce825e..7e978feaf822 100644
> > > --- a/tools/lib/bpf/libbpf.c
> > > +++ b/tools/lib/bpf/libbpf.c
> > > @@ -2795,7 +2795,7 @@ static int btf_fixup_datasec(struct bpf_object *obj, struct btf *btf,
> > >                 goto sort_vars;
> > >
> > >         ret = find_elf_sec_sz(obj, name, &size);
> > > -       if (ret || !size || (t->size && t->size != size)) {
> >
> > t->size check is redundant, but  (t->size != size) is not
>
> ah, never mind :) applied to bpf-next
>
> >
> > > +       if (ret || !size) {
> > >                 pr_debug("Invalid size for section %s: %u bytes\n", name, size);
> > >                 return -ENOENT;
> > >         }
> > > --
> > > 2.35.1
> > >

Thanks for your reply.

It seems that the patch has not been applied to bpf-next yet,
I can't find it in the commits on the master branch.

Is there anything else I need to do?

  reply	other threads:[~2022-02-21 16:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-20  7:27 [PATCH bpf-next] libbpf: Remove redundant check in btf_fixup_datasec() Yuntao Wang
2022-02-20 20:15 ` Andrii Nakryiko
2022-02-20 20:19   ` Andrii Nakryiko
2022-02-21 16:22     ` Yuntao Wang [this message]
2022-02-22 22:40 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220221162250.245059-1-ytcoode@gmail.com \
    --to=ytcoode@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox