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

selftests/resctrl: ksft_exit_skip() 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 calls to ksft_exit_skip(), as __noreturn prevents
the compiler from warning that a caller of ksft_exit_skip() does not
return a value because the program will terminate upon calling these
functions.

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
47b59f36 a3bf0755

+3 -3
+3 -3
tools/testing/selftests/resctrl/resctrl_tests.c
··· 247 247 * 2. We execute perf commands 248 248 */ 249 249 if (geteuid() != 0) 250 - return ksft_exit_skip("Not running as root. Skipping...\n"); 250 + ksft_exit_skip("Not running as root. Skipping...\n"); 251 251 252 252 if (!check_resctrlfs_support()) 253 - return ksft_exit_skip("resctrl FS does not exist. Enable X86_CPU_RESCTRL config option.\n"); 253 + ksft_exit_skip("resctrl FS does not exist. Enable X86_CPU_RESCTRL config option.\n"); 254 254 255 255 if (umount_resctrlfs()) 256 - return ksft_exit_skip("resctrl FS unmount failed.\n"); 256 + ksft_exit_skip("resctrl FS unmount failed.\n"); 257 257 258 258 filter_dmesg(); 259 259