public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Emil Tsalapatis" <emil@etsalapatis.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v8 7/8] selftests/bpf: Add selftests for libarena buddy allocator
Date: Tue, 21 Apr 2026 21:57:39 +0000	[thread overview]
Message-ID: <20260421215740.B3DB3C2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260421165037.4736-8-emil@etsalapatis.com>

Sashiko AI review found 1 potential issue(s):
- [Low] Using the `%lx` format specifier for a pointer type without a cast causes a compiler warning in BPF selftests.
--

commit 5722468489c153ff642e633e17b799603b516db1
Author: Emil Tsalapatis <emil@etsalapatis.com>

selftests/bpf: Add selftests for libarena buddy allocator
    
Introduce selftests for the buddy allocator with and without ASAN. Add the
libarena selftests both to the libarena test runner and to test_progs,
and add logic in the Makefile to only compile the ASAN variant if the
compiler supports it.

> diff --git a/tools/testing/selftests/bpf/libarena/selftests/st_buddy.bpf.c b/tools/testing/selftests/bpf/libarena/selftests/st_buddy.bpf.c
> new file mode 100644
> index 0000000000000..b12d18790fa53
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/libarena/selftests/st_buddy.bpf.c
[ ... ]
> +SEC("syscall")
> +__weak int test_buddy_alloc_multiple(void)
> +{
[ ... ]
> +	for (i = 10; i < SEGARRLEN && can_loop; i++) {
> +		idx = (i * 17) % SEGARRLEN;
> +
> +		mem = segarr[idx].block;
> +		sz = segarr[idx].sz;
> +		poison = segarr[idx].poison;
> +
> +		for (j = zero; j < sz && can_loop; j++) {
> +			if (mem[j] != poison) {
> +				buddy_destroy(&buddy);
> +				arena_stdout("%s:%d %lx %u vs %u", __func__,
> +					   __LINE__, &mem[j], mem[j], poison);

Does passing a pointer to the %lx format specifier cause a compiler warning
here?

Since &mem[j] is a pointer type (u8 __arena *), passing it to %lx without a
cast usually triggers a format warning. Because BPF selftests are compiled
with -Werror, this can break the build.

Should it be cast to an integer type like (unsigned long), similar to how
it is handled later on in test_buddy_alignment()?

> +				return -EINVAL;
> +			}
> +		}
> +
> +		buddy_free(&buddy, mem);
> +	}
> +
> +	buddy_destroy(&buddy);
> +
> +	return 0;
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260421165037.4736-1-emil@etsalapatis.com?part=7

  reply	other threads:[~2026-04-21 21:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21 16:50 [PATCH bpf-next v8 0/8] Introduce arena library and runtime Emil Tsalapatis
2026-04-21 16:50 ` [PATCH bpf-next v8 1/8] selftests/bpf: Add ifdef guard for WRITE_ONCE macro in bpf_atomic.h Emil Tsalapatis
2026-04-21 16:50 ` [PATCH bpf-next v8 2/8] selftests/bpf: Add basic libarena scaffolding Emil Tsalapatis
2026-04-21 20:08   ` sashiko-bot
2026-04-21 16:50 ` [PATCH bpf-next v8 3/8] selftests/bpf: Move arena-related headers into libarena Emil Tsalapatis
2026-04-21 16:50 ` [PATCH bpf-next v8 4/8] selftests/bpf: Add arena ASAN runtime to libarena Emil Tsalapatis
2026-04-21 20:48   ` sashiko-bot
2026-04-21 16:50 ` [PATCH bpf-next v8 5/8] selftests/bpf: Add ASAN support for libarena selftests Emil Tsalapatis
2026-04-21 21:15   ` sashiko-bot
2026-04-21 16:50 ` [PATCH bpf-next v8 6/8] selftests/bpf: Add buddy allocator for libarena Emil Tsalapatis
2026-04-21 17:52   ` bot+bpf-ci
2026-04-21 17:56     ` Emil Tsalapatis
2026-04-21 21:42   ` sashiko-bot
2026-04-21 16:50 ` [PATCH bpf-next v8 7/8] selftests/bpf: Add selftests for libarena buddy allocator Emil Tsalapatis
2026-04-21 21:57   ` sashiko-bot [this message]
2026-04-21 16:50 ` [PATCH bpf-next v8 8/8] selftests/bpf: Reuse stderr parsing for libarena ASAN tests Emil Tsalapatis
2026-04-21 22:16   ` sashiko-bot

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=20260421215740.B3DB3C2BCB0@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=emil@etsalapatis.com \
    --cc=sashiko@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox