Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] selftests: dead code due to ASSERT_EQ abort semantics
--

commit 9691dbbeea14ab3039a7e9d6bdc6fcfa2fc670a9
Author: Jeff Barnes <[email protected]>

selftests/user_events: Test registration from existing threads

This commit adds a test to verify user event registration from existing
threads. It creates two threads that attempt to register events using the
same enable address and bit. The test checks that the second registration
fails with EADDRINUSE because they share the same address space.

> diff --git a/tools/testing/selftests/user_events/abi_test.c 
> b/tools/testing/selftests/user_events/abi_test.c
> index b71813eaf5c04..bb1a17ce00da0 100644
> --- a/tools/testing/selftests/user_events/abi_test.c
> +++ b/tools/testing/selftests/user_events/abi_test.c

[ ... ]

> @@ -258,6 +259,137 @@ FIXTURE_TEARDOWN(user) {

[ ... ]

> +TEST_F(user, preexisting_threads_same_address) {

[ ... ]

> +     ASSERT_EQ(-1, registration.second_ret);
> +     ASSERT_EQ(EADDRINUSE, registration.second_errno);
> +
> +     if (!registration.second_ret)
> +             ASSERT_EQ(0, registration.second_unreg_ret);
> +}

[Severity: Low]
Are the conditional and its assertion here reachable?

The kselftest framework's ASSERT_EQ() aborts the test via __bail() if the
values do not match. The preceding ASSERT_EQ(-1, registration.second_ret)
means that execution only continues if registration.second_ret is -1.

If registration.second_ret is -1, then !registration.second_ret will
always evaluate to false, skipping the second assertion.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to