BPF List
 help / color / mirror / Atom feed
* [PATCH] selftests/bpf: remove unused duration variable
@ 2026-10-15 17:31 pdsj2807
  2026-10-15 17:35 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: pdsj2807 @ 2026-10-15 17:31 UTC (permalink / raw)
  To: andrii, eddyz87
  Cc: ast, daniel, memxor, shuah, bpf, linux-kselftest, linux-kernel,
	Palak Raval

From: Palak Raval <pdsj2807@gmail.com>

The duration variable in cgroup_attach_override.c is not referenced
anywhere in the file.

Remove the unused variable.

Signed-off-by: Palak Raval <pdsj2807@gmail.com>
---
 tools/testing/selftests/bpf/prog_tests/cgroup_attach_override.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/cgroup_attach_override.c b/tools/testing/selftests/bpf/prog_tests/cgroup_attach_override.c
index 9421a5b7f4e1..28a946e2a736 100644
--- 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",
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests/bpf: remove unused duration variable
  2026-10-15 17:31 [PATCH] selftests/bpf: remove unused duration variable pdsj2807
@ 2026-10-15 17:35 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-10-15 17:35 UTC (permalink / raw)
  To: pdsj2807; +Cc: bpf

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-15 17:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15 17:31 [PATCH] selftests/bpf: remove unused duration variable pdsj2807
2026-10-15 17:35 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox