BPF List
 help / color / mirror / Atom feed
From: Bagas Sanjaya <bagasdotme@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Xu Kuohai <xukuohai@huaweicloud.com>, bpf <bpf@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	John Fastabend <john.fastabend@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Song Liu <song@kernel.org>, Yonghong Song <yhs@fb.com>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>,
	"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH bpf-next] bpf: Fix a typo in comment for DFS algorithm
Date: Wed, 26 Oct 2022 14:52:54 +0700	[thread overview]
Message-ID: <Y1jnVvcqVF8GanWZ@debian.me> (raw)
In-Reply-To: <CAADnVQ+Pe73yjys+fjW1TBPscCmv6K9ur5bDPr2056ejwBBdZg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1350 bytes --]

On Tue, Oct 25, 2022 at 11:32:55PM -0700, Alexei Starovoitov wrote:
> On Tue, Oct 25, 2022 at 7:42 PM Xu Kuohai <xukuohai@huaweicloud.com> wrote:
> >
> > From: Xu Kuohai <xukuohai@huawei.com>
> >
> > There is a typo in comment for DFS algorithm in bpf/verifier.c. The top
> > element should not be popped until all its neighbors have been checked.
> > Fix it.
> >
> > Fixes: 475fb78fbf48 ("bpf: verifier (add branch/goto checks)")
> > Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
> > ---
> >  kernel/bpf/verifier.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> > index b83a8d420520..96ba5ea6d1a6 100644
> > --- a/kernel/bpf/verifier.c
> > +++ b/kernel/bpf/verifier.c
> > @@ -10662,7 +10662,7 @@ static int check_return_code(struct bpf_verifier_env *env)
> >   * 3      let S be a stack
> >   * 4      S.push(v)
> >   * 5      while S is not empty
> > - * 6            t <- S.pop()
> > + * 6            t <- S.top()
> 
> Even with this fix the comment is not quite accurate.
> I wonder whether we should keep it or delete it completely.
> At least please use 'peek' instead of 'top'.

I think the comment should be in words (like other code comments in the
kernel) instead.

-- 
An old man doll... just what I always wanted! - Clara

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2022-10-26  7:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26  2:59 [PATCH bpf-next] bpf: Fix a typo in comment for DFS algorithm Xu Kuohai
2022-10-26  6:32 ` Alexei Starovoitov
2022-10-26  7:52   ` Bagas Sanjaya [this message]
2022-10-26 12:06     ` Xu Kuohai
2022-10-26 12:04   ` Xu Kuohai

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=Y1jnVvcqVF8GanWZ@debian.me \
    --to=bagasdotme@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=xukuohai@huaweicloud.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