Searched hist:a3bf0755f01568493e1f2e83ff98284c8c12e35d (Results 1 – 4 of 4) sorted by relevance
/linux/tools/testing/selftests/pidfd/ |
H A D | pidfd_poll_test.c | diff a3bf0755f01568493e1f2e83ff98284c8c12e35d Wed Apr 24 19:24:08 CEST 2024 Nathan Chancellor <nathan@kernel.org> selftests: pidfd: ksft_exit functions do not return
After commit f7d5bcd35d42 ("selftests: kselftest: Mark functions that unconditionally call exit() as __noreturn"), ksft_exit_...() functions are marked as __noreturn, which means the return type should not be 'int' but 'void' because they are not returning anything (and never were since exit() has always been called).
To facilitate updating the return type of these functions, remove 'return' before the calls to ksft_exit_{pass,fail}(), as __noreturn prevents the compiler from warning that a caller of the ksft_exit functions does not return a value because the program will terminate upon calling these functions.
Just removing 'return' would have resulted in
!ret ? ksft_exit_pass() : ksft_exit_fail();
so convert that into the more idiomatic
if (ret) ksft_exit_fail(); ksft_exit_pass();
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
|
H A D | pidfd_fdinfo_test.c | diff a3bf0755f01568493e1f2e83ff98284c8c12e35d Wed Apr 24 19:24:08 CEST 2024 Nathan Chancellor <nathan@kernel.org> selftests: pidfd: ksft_exit functions do not return
After commit f7d5bcd35d42 ("selftests: kselftest: Mark functions that unconditionally call exit() as __noreturn"), ksft_exit_...() functions are marked as __noreturn, which means the return type should not be 'int' but 'void' because they are not returning anything (and never were since exit() has always been called).
To facilitate updating the return type of these functions, remove 'return' before the calls to ksft_exit_{pass,fail}(), as __noreturn prevents the compiler from warning that a caller of the ksft_exit functions does not return a value because the program will terminate upon calling these functions.
Just removing 'return' would have resulted in
!ret ? ksft_exit_pass() : ksft_exit_fail();
so convert that into the more idiomatic
if (ret) ksft_exit_fail(); ksft_exit_pass();
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
|
H A D | pidfd_open_test.c | diff a3bf0755f01568493e1f2e83ff98284c8c12e35d Wed Apr 24 19:24:08 CEST 2024 Nathan Chancellor <nathan@kernel.org> selftests: pidfd: ksft_exit functions do not return
After commit f7d5bcd35d42 ("selftests: kselftest: Mark functions that unconditionally call exit() as __noreturn"), ksft_exit_...() functions are marked as __noreturn, which means the return type should not be 'int' but 'void' because they are not returning anything (and never were since exit() has always been called).
To facilitate updating the return type of these functions, remove 'return' before the calls to ksft_exit_{pass,fail}(), as __noreturn prevents the compiler from warning that a caller of the ksft_exit functions does not return a value because the program will terminate upon calling these functions.
Just removing 'return' would have resulted in
!ret ? ksft_exit_pass() : ksft_exit_fail();
so convert that into the more idiomatic
if (ret) ksft_exit_fail(); ksft_exit_pass();
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
|
H A D | pidfd_test.c | diff a3bf0755f01568493e1f2e83ff98284c8c12e35d Wed Apr 24 19:24:08 CEST 2024 Nathan Chancellor <nathan@kernel.org> selftests: pidfd: ksft_exit functions do not return
After commit f7d5bcd35d42 ("selftests: kselftest: Mark functions that unconditionally call exit() as __noreturn"), ksft_exit_...() functions are marked as __noreturn, which means the return type should not be 'int' but 'void' because they are not returning anything (and never were since exit() has always been called).
To facilitate updating the return type of these functions, remove 'return' before the calls to ksft_exit_{pass,fail}(), as __noreturn prevents the compiler from warning that a caller of the ksft_exit functions does not return a value because the program will terminate upon calling these functions.
Just removing 'return' would have resulted in
!ret ? ksft_exit_pass() : ksft_exit_fail();
so convert that into the more idiomatic
if (ret) ksft_exit_fail(); ksft_exit_pass();
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
|