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/selftests: use ARRAY_SIZE macro in st_asan_buddy.bpf.c
Date: Thu, 16 Jul 2026 07:23:26 +0000	[thread overview]
Message-ID: <20260716072326.8FD721F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260716071110.560-1-yanlonglong@kylinos.cn>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The commit introduces the `ARRAY_SIZE` macro into a BPF program without defining or including it, causing a compilation failure.
--

--- Patch [1]: [PATCH] libarena/selftests: use ARRAY_SIZE macro in st_asan_buddy.bpf.c ---
commit 70521e8b40248839f7100def222aa4fb06724c32
Author: longlong yan <yanlonglong@kylinos.cn>
libarena/selftests: use ARRAY_SIZE macro in st_asan_buddy.bpf.c

This commit replaces manual array size calculations with the ARRAY_SIZE macro 
in the asan_test_buddy_oob and asan_test_buddy_uaf functions to make the code 
more compact.

> diff --git a/tools/testing/selftests/bpf/libarena/selftests/test_asan_buddy.bpf.c b/tools/testing/selftests/bpf/libarena/selftests/test_asan_buddy.bpf.c
> index 3266a28f53d76..9c94a5167a503 100644
> --- a/tools/testing/selftests/bpf/libarena/selftests/test_asan_buddy.bpf.c
> +++ b/tools/testing/selftests/bpf/libarena/selftests/test_asan_buddy.bpf.c
> @@ -163,7 +163,7 @@ __weak int asan_test_buddy_oob(void)
>  		return ret;
>  	}
>  
> -	for (i = zero; i < sizeof(sizes) / sizeof(sizes[0]) && can_loop; i++) {
> +	for (i = zero; i < ARRAY_SIZE(sizes) && can_loop; i++) {

[Severity: Low]
Does this cause a compilation failure when building the BPF selftests?

It appears that ARRAY_SIZE is not defined in this BPF program or its currently
included headers. Would we need to define ARRAY_SIZE locally in this file, or
include a header that provides it specifically for BPF environments?

[ ... ]

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

      reply	other threads:[~2026-07-16  7:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16  7:11 [PATCH] libarena/selftests: use ARRAY_SIZE macro in st_asan_buddy.bpf.c longlong yan
2026-07-16  7:23 ` sashiko-bot [this message]

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=20260716072326.8FD721F00A3A@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.