Skip to content

Commit 47b59f3

Browse files
nathanchanceshuahkh
authored andcommitted
selftests/resctrl: ksft_exit_skip() does not return
After commit f7d5bcd ("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 <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent a3bf075 commit 47b59f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/testing/selftests/resctrl/resctrl_tests.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,13 @@ int main(int argc, char **argv)
247247
* 2. We execute perf commands
248248
*/
249249
if (geteuid() != 0)
250-
return ksft_exit_skip("Not running as root. Skipping...\n");
250+
ksft_exit_skip("Not running as root. Skipping...\n");
251251

252252
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");
254254

255255
if (umount_resctrlfs())
256-
return ksft_exit_skip("resctrl FS unmount failed.\n");
256+
ksft_exit_skip("resctrl FS unmount failed.\n");
257257

258258
filter_dmesg();
259259

0 commit comments

Comments
 (0)