* [PATCH v1] selftests/bpf: Fix unnecessary conversion to bool in 'run_subtest'
@ 2024-11-17 10:28 guanjing
2024-11-21 6:38 ` John Fastabend
2024-11-25 22:34 ` Alexei Starovoitov
0 siblings, 2 replies; 3+ messages in thread
From: guanjing @ 2024-11-17 10:28 UTC (permalink / raw)
To: andrii, eddyz87, mykolal, ast, daniel, martin.lau, song,
yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, shuah
Cc: bpf, linux-kselftest, linux-kernel, guanjing
Fixes the following coccicheck:
tools/testing/selftests/bpf/test_loader.c:1033:64-69: WARNING: conversion to bool not needed here
Fixes: 80a4129fcf20 ("selftests/bpf: Add unit tests for bpf_arena_alloc/free_pages")
Signed-off-by: guanjing <guanjing@cmss.chinamobile.com>
---
tools/testing/selftests/bpf/test_loader.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/test_loader.c b/tools/testing/selftests/bpf/test_loader.c
index 3e9b009580d4..400f56f81272 100644
--- a/tools/testing/selftests/bpf/test_loader.c
+++ b/tools/testing/selftests/bpf/test_loader.c
@@ -1030,7 +1030,7 @@ void run_subtest(struct test_loader *tester,
}
do_prog_test_run(bpf_program__fd(tprog), &retval,
- bpf_program__type(tprog) == BPF_PROG_TYPE_SYSCALL ? true : false);
+ bpf_program__type(tprog) == BPF_PROG_TYPE_SYSCALL);
if (retval != subspec->retval && subspec->retval != POINTER_VALUE) {
PRINT_FAIL("Unexpected retval: %d != %d\n", retval, subspec->retval);
goto tobj_cleanup;
--
2.33.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* RE: [PATCH v1] selftests/bpf: Fix unnecessary conversion to bool in 'run_subtest'
2024-11-17 10:28 [PATCH v1] selftests/bpf: Fix unnecessary conversion to bool in 'run_subtest' guanjing
@ 2024-11-21 6:38 ` John Fastabend
2024-11-25 22:34 ` Alexei Starovoitov
1 sibling, 0 replies; 3+ messages in thread
From: John Fastabend @ 2024-11-21 6:38 UTC (permalink / raw)
To: guanjing, andrii, eddyz87, mykolal, ast, daniel, martin.lau, song,
yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, shuah
Cc: bpf, linux-kselftest, linux-kernel, guanjing
guanjing wrote:
> Fixes the following coccicheck:
>
> tools/testing/selftests/bpf/test_loader.c:1033:64-69: WARNING: conversion to bool not needed here
>
> Fixes: 80a4129fcf20 ("selftests/bpf: Add unit tests for bpf_arena_alloc/free_pages")
> Signed-off-by: guanjing <guanjing@cmss.chinamobile.com>
> ---
I'll argue this is bpf-next and no need for a fixes tag here.
> tools/testing/selftests/bpf/test_loader.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/test_loader.c b/tools/testing/selftests/bpf/test_loader.c
> index 3e9b009580d4..400f56f81272 100644
> --- a/tools/testing/selftests/bpf/test_loader.c
> +++ b/tools/testing/selftests/bpf/test_loader.c
> @@ -1030,7 +1030,7 @@ void run_subtest(struct test_loader *tester,
> }
>
> do_prog_test_run(bpf_program__fd(tprog), &retval,
> - bpf_program__type(tprog) == BPF_PROG_TYPE_SYSCALL ? true : false);
> + bpf_program__type(tprog) == BPF_PROG_TYPE_SYSCALL);
> if (retval != subspec->retval && subspec->retval != POINTER_VALUE) {
> PRINT_FAIL("Unexpected retval: %d != %d\n", retval, subspec->retval);
> goto tobj_cleanup;
> --
> 2.33.0
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v1] selftests/bpf: Fix unnecessary conversion to bool in 'run_subtest'
2024-11-17 10:28 [PATCH v1] selftests/bpf: Fix unnecessary conversion to bool in 'run_subtest' guanjing
2024-11-21 6:38 ` John Fastabend
@ 2024-11-25 22:34 ` Alexei Starovoitov
1 sibling, 0 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2024-11-25 22:34 UTC (permalink / raw)
To: guanjing
Cc: Andrii Nakryiko, Eddy Z, Mykola Lysenko, Alexei Starovoitov,
Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, bpf, open list:KERNEL SELFTEST FRAMEWORK, LKML
On Tue, Nov 19, 2024 at 1:36 AM guanjing <guanjing@cmss.chinamobile.com> wrote:
>
> Fixes the following coccicheck:
>
> tools/testing/selftests/bpf/test_loader.c:1033:64-69: WARNING: conversion to bool not needed here
>
> Fixes: 80a4129fcf20 ("selftests/bpf: Add unit tests for bpf_arena_alloc/free_pages")
> Signed-off-by: guanjing <guanjing@cmss.chinamobile.com>
Pls use your full name.
pw-bot: cr
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-25 22:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-17 10:28 [PATCH v1] selftests/bpf: Fix unnecessary conversion to bool in 'run_subtest' guanjing
2024-11-21 6:38 ` John Fastabend
2024-11-25 22:34 ` Alexei Starovoitov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox