Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: sync: ksft_exit_pass() does 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 call to ksft_exit_pass(), as __noreturn prevents the
compiler from warning that a caller of ksft_exit_pass() does not return
a value because the program will terminate upon calling these functions
(which is what the comment alluded to as well).

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>

authored by

Nathan Chancellor and committed by
Shuah Khan
102690be 47b59f36

+1 -2
+1 -2
tools/testing/selftests/sync/sync_test.c
··· 109 109 ksft_exit_fail_msg("%d out of %d sync tests failed\n", 110 110 err, ksft_test_num()); 111 111 112 - /* need this return to keep gcc happy */ 113 - return ksft_exit_pass(); 112 + ksft_exit_pass(); 114 113 }