All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: pdsj2807@gmail.com
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH] selftests/bpf: remove unused duration variable
Date: Thu, 15 Oct 2026 17:35:51 +0000	[thread overview]
Message-ID: <sashiko-outbox-173257@kernel.org> (raw)
In-Reply-To: <20261015173142.1361483-1-pdsj2807@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] selftests/bpf: build failure from removing duration variable used by CHECK macro
--

commit 554358d3f4b47b8628cdfddabbecc7bb2c5d4380
Author: Palak Raval <pdsj2807@gmail.com>

selftests/bpf: remove unused duration variable

This commit removes the local duration variable from
cgroup_attach_override.c, stating that it is not referenced anywhere in the
file.

> diff --git a/tools/testing/selftests/bpf/prog_tests/cgroup_attach_override.c b/tools/testing/selftests/bpf/prog_tests/cgroup_attach_override.c
> --- a/tools/testing/selftests/bpf/prog_tests/cgroup_attach_override.c
> +++ b/tools/testing/selftests/bpf/prog_tests/cgroup_attach_override.c
> @@ -26,7 +26,6 @@ static int prog_load(int verdict)
>  void serial_test_cgroup_attach_override(void)
>  {
>  	int drop_prog = -1, allow_prog = -1, foo = -1, bar = -1;
> -	__u32 duration = 0;
>  
>  	allow_prog = prog_load(1);
>  	if (CHECK(allow_prog < 0, "prog_load_allow",
>  		  "verifier output:\n%s\n-------\n", bpf_log_buf))

[Severity: Low]
Will this code continue to compile after removing the duration variable?

In BPF selftests, the legacy CHECK macro implicitly references a variable
named duration from the caller's scope to track test execution time. Removing
it here in serial_test_cgroup_attach_override() leaves the duration symbol
undeclared, which will cause the build to fail when the CHECK macro expands
immediately after this change.

Would it be better to migrate these checks to modern macros like ASSERT_OK()
first, so the duration variable can then be safely removed?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261015173142.1361483-1-pdsj2807@gmail.com?part=1

      reply	other threads:[~2026-10-15 17:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 17:31 [PATCH] selftests/bpf: remove unused duration variable pdsj2807
2026-10-15 17:35 ` 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=sashiko-outbox-173257@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=pdsj2807@gmail.com \
    --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.