All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "longlong yan" <yanlonglong@kylinos.cn>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH] libarena: use ARRAY_SIZE macro in test_rbtree.bpf.c
Date: Fri, 17 Jul 2026 06:57:43 +0000	[thread overview]
Message-ID: <20260717065743.957721F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260717064719.1032-1-yanlonglong@kylinos.cn>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The `ARRAY_SIZE` macro is used but never defined, resulting in a build failure.
--

--- Patch [1]: [PATCH] libarena: use ARRAY_SIZE macro in test_rbtree.bpf.c ---
commit 49bb37468e341cf82c49ff84b927aa30773d6092
Author: longlong yan <yanlonglong@kylinos.cn>

libarena: use ARRAY_SIZE macro in test_rbtree.bpf.c

This commit replaces manual array size calculations with the ARRAY_SIZE
macro throughout the test_rbtree.bpf.c selftest.

> diff --git a/tools/testing/selftests/bpf/libarena/selftests/test_rbtree.bpf.c b/tools/testing/selftests/bpf/libarena/selftests/test_rbtree.bpf.c
> index 856c484a009a8..f6e15f77cdf5a 100644
> --- a/tools/testing/selftests/bpf/libarena/selftests/test_rbtree.bpf.c
> +++ b/tools/testing/selftests/bpf/libarena/selftests/test_rbtree.bpf.c
> @@ -275,7 +275,7 @@ clean_up_noalloc_tree(struct rbtree __arena *rbtree)
>  
>  int insert_many(enum rbtree_alloc alloc, enum rbtree_insert_mode insert)
>  {
> -	const size_t numkeys = sizeof(keys) / sizeof(keys[0]);
> +	const size_t numkeys = ARRAY_SIZE(keys);

[Severity: Low]
Does this code fail to build because ARRAY_SIZE is not defined?

It appears ARRAY_SIZE is not provided by the headers included in this 
translation unit, which could cause the compiler to reject it as an
undeclared identifier during the selftest compilation.

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260717064719.1032-1-yanlonglong@kylinos.cn?part=1

  reply	other threads:[~2026-07-17  6:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17  6:47 [PATCH] libarena: use ARRAY_SIZE macro in test_rbtree.bpf.c longlong yan
2026-07-17  6:57 ` sashiko-bot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-17  7:32 longlong yan
2026-07-17  8:29 ` bot+bpf-ci

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=20260717065743.957721F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=yanlonglong@kylinos.cn \
    /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.