All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kaitao Cheng" <kaitao.cheng@linux.dev>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v11 7/8] bpf: add bpf_list_is_first/last/empty kfuncs
Date: Thu, 21 May 2026 13:29:13 +0000	[thread overview]
Message-ID: <20260521132913.EAC621F00A3B@smtp.kernel.org> (raw)
In-Reply-To: <20260521032306.97118-8-kaitao.cheng@linux.dev>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Multi-line comment uses deprecated style in `bpf_list_empty`.
--

commit 22a1ce2a5267998c134b07d40be7e92224236cc6
Author: Kaitao Cheng <chengkaitao@kylinos.cn>

bpf: add bpf_list_is_first/last/empty kfuncs

This commit adds three new kfuncs to allow BPF programs to directly query
whether a node is the first or last in a linked list, or if the list is
empty. This avoids the inefficiency of having to pop and push nodes just
to check these properties.

> diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
> index 89579165ef4dc..b6c3d02d5593c 100644
> --- a/kernel/bpf/helpers.c
> +++ b/kernel/bpf/helpers.c
[ ... ]
> @@ -2656,6 +2656,43 @@ __bpf_kfunc struct bpf_list_node *bpf_list_back(struct bpf_list_head *head)
[ ... ]
> +__bpf_kfunc bool bpf_list_empty(struct bpf_list_head *head)
> +{
> +	struct list_head *h = (struct list_head *)head;
> +
> +	/* If list_head was 0-initialized by map, bpf_obj_init_field wasn't
> +	 * called on its fields, so init here
> +	 */

[Severity: Low]
This isn't a bug, but the multi-line comment uses a deprecated style.
According to BPF subsystem guidelines, multi-line comments should have the
opening /* on its own line.

> +	if (unlikely(!h->next))
> +		INIT_LIST_HEAD(h);
> +
> +	return list_empty(h);
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260521032306.97118-1-kaitao.cheng@linux.dev?part=7

  reply	other threads:[~2026-05-21 13:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21  3:22 [PATCH bpf-next v11 0/8] bpf: Extend the bpf_list family of APIs Kaitao Cheng
2026-05-21  3:22 ` [PATCH bpf-next v11 1/8] bpf: refactor __bpf_list_del to take list node pointer Kaitao Cheng
2026-05-21  3:23 ` [PATCH bpf-next v11 2/8] bpf: clear list node owner and unlink before drop Kaitao Cheng
2026-05-21  4:08   ` bot+bpf-ci
2026-05-21  4:30   ` sashiko-bot
2026-05-21  6:11     ` Kaitao Cheng
2026-05-21  3:23 ` [PATCH bpf-next v11 3/8] bpf: allow non-owning list-node args via __nonown_allowed Kaitao Cheng
2026-05-21  4:08   ` bot+bpf-ci
2026-05-21  6:29     ` Kaitao Cheng
2026-05-21  3:23 ` [PATCH bpf-next v11 4/8] bpf: Introduce the bpf_list_del kfunc Kaitao Cheng
2026-05-21  4:08   ` bot+bpf-ci
2026-05-21  6:59     ` Kaitao Cheng
2026-05-21  3:23 ` [PATCH bpf-next v11 5/8] bpf: refactor __bpf_list_add to take insertion point via **prev_ptr Kaitao Cheng
2026-05-21  3:23 ` [PATCH bpf-next v11 6/8] bpf: Add bpf_list_add to insert node after a given list node Kaitao Cheng
2026-05-21  4:08   ` bot+bpf-ci
2026-05-21  7:35     ` Kaitao Cheng
2026-05-21 12:49   ` sashiko-bot
2026-05-21  3:23 ` [PATCH bpf-next v11 7/8] bpf: add bpf_list_is_first/last/empty kfuncs Kaitao Cheng
2026-05-21 13:29   ` sashiko-bot [this message]
2026-05-21  3:23 ` [PATCH bpf-next v11 8/8] selftests/bpf: Add test cases for bpf_list_del/add/is_first/is_last/empty Kaitao Cheng
2026-05-21  4:08   ` bot+bpf-ci
2026-05-21 10:00 ` [PATCH bpf-next v11 0/8] bpf: Extend the bpf_list family of APIs 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=20260521132913.EAC621F00A3B@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=kaitao.cheng@linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.