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

selftests/mm: 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_...(), 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.

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
69e545ed a9c91ecd

+13 -13
+3 -3
tools/testing/selftests/mm/compaction_test.c
··· 177 177 ksft_print_header(); 178 178 179 179 if (prereq() || geteuid()) 180 - return ksft_exit_skip("Prerequisites unsatisfied\n"); 180 + ksft_exit_skip("Prerequisites unsatisfied\n"); 181 181 182 182 ksft_set_plan(1); 183 183 ··· 225 225 } 226 226 227 227 if (check_compaction(mem_free, hugepage_size) == 0) 228 - return ksft_exit_pass(); 228 + ksft_exit_pass(); 229 229 230 - return ksft_exit_fail(); 230 + ksft_exit_fail(); 231 231 }
+1 -1
tools/testing/selftests/mm/cow.c
··· 1779 1779 if (err) 1780 1780 ksft_exit_fail_msg("%d out of %d tests failed\n", 1781 1781 err, ksft_test_num()); 1782 - return ksft_exit_pass(); 1782 + ksft_exit_pass(); 1783 1783 }
+1 -1
tools/testing/selftests/mm/gup_longterm.c
··· 456 456 if (err) 457 457 ksft_exit_fail_msg("%d out of %d tests failed\n", 458 458 err, ksft_test_num()); 459 - return ksft_exit_pass(); 459 + ksft_exit_pass(); 460 460 }
+2 -2
tools/testing/selftests/mm/gup_test.c
··· 228 228 break; 229 229 } 230 230 ksft_test_result_skip("Please run this test as root\n"); 231 - return ksft_exit_pass(); 231 + ksft_exit_pass(); 232 232 } 233 233 234 234 p = mmap(NULL, size, PROT_READ | PROT_WRITE, flags, filed, 0); ··· 267 267 268 268 free(tid); 269 269 270 - return ksft_exit_pass(); 270 + ksft_exit_pass(); 271 271 }
+1 -1
tools/testing/selftests/mm/ksm_functional_tests.c
··· 646 646 if (err) 647 647 ksft_exit_fail_msg("%d out of %d tests failed\n", 648 648 err, ksft_test_num()); 649 - return ksft_exit_pass(); 649 + ksft_exit_pass(); 650 650 }
+1 -1
tools/testing/selftests/mm/madv_populate.c
··· 307 307 if (err) 308 308 ksft_exit_fail_msg("%d out of %d tests failed\n", 309 309 err, ksft_test_num()); 310 - return ksft_exit_pass(); 310 + ksft_exit_pass(); 311 311 }
+1 -1
tools/testing/selftests/mm/mkdirty.c
··· 375 375 if (err) 376 376 ksft_exit_fail_msg("%d out of %d tests failed\n", 377 377 err, ksft_test_num()); 378 - return ksft_exit_pass(); 378 + ksft_exit_pass(); 379 379 }
+2 -2
tools/testing/selftests/mm/pagemap_ioctl.c
··· 1484 1484 ksft_print_header(); 1485 1485 1486 1486 if (init_uffd()) 1487 - return ksft_exit_pass(); 1487 + ksft_exit_pass(); 1488 1488 1489 1489 ksft_set_plan(115); 1490 1490 ··· 1660 1660 userfaultfd_tests(); 1661 1661 1662 1662 close(pagemap_fd); 1663 - return ksft_exit_pass(); 1663 + ksft_exit_pass(); 1664 1664 }
+1 -1
tools/testing/selftests/mm/soft-dirty.c
··· 209 209 210 210 close(pagemap_fd); 211 211 212 - return ksft_exit_pass(); 212 + ksft_exit_pass(); 213 213 }