selftests/mm: ksft_exit functions do not return
[ Upstream commit69e545edbe
] After commitf7d5bcd35d
("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> Stable-dep-of:fb9293b6b0
("selftests/mm: compaction_test: fix bogus test success and reduce probability of OOM-killer invocation") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2c1830c4b8
commit
442f84e497
@ -185,7 +185,7 @@ int main(int argc, char **argv)
|
||||
ksft_print_header();
|
||||
|
||||
if (prereq() || geteuid())
|
||||
return ksft_exit_skip("Prerequisites unsatisfied\n");
|
||||
ksft_exit_skip("Prerequisites unsatisfied\n");
|
||||
|
||||
ksft_set_plan(1);
|
||||
|
||||
@ -233,7 +233,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (check_compaction(mem_free, hugepage_size) == 0)
|
||||
return ksft_exit_pass();
|
||||
ksft_exit_pass();
|
||||
|
||||
return ksft_exit_fail();
|
||||
ksft_exit_fail();
|
||||
}
|
||||
|
@ -1779,5 +1779,5 @@ int main(int argc, char **argv)
|
||||
if (err)
|
||||
ksft_exit_fail_msg("%d out of %d tests failed\n",
|
||||
err, ksft_test_num());
|
||||
return ksft_exit_pass();
|
||||
ksft_exit_pass();
|
||||
}
|
||||
|
@ -456,5 +456,5 @@ int main(int argc, char **argv)
|
||||
if (err)
|
||||
ksft_exit_fail_msg("%d out of %d tests failed\n",
|
||||
err, ksft_test_num());
|
||||
return ksft_exit_pass();
|
||||
ksft_exit_pass();
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
ksft_test_result_skip("Please run this test as root\n");
|
||||
return ksft_exit_pass();
|
||||
ksft_exit_pass();
|
||||
}
|
||||
|
||||
p = mmap(NULL, size, PROT_READ | PROT_WRITE, flags, filed, 0);
|
||||
@ -268,5 +268,5 @@ int main(int argc, char **argv)
|
||||
|
||||
free(tid);
|
||||
|
||||
return ksft_exit_pass();
|
||||
ksft_exit_pass();
|
||||
}
|
||||
|
@ -646,5 +646,5 @@ int main(int argc, char **argv)
|
||||
if (err)
|
||||
ksft_exit_fail_msg("%d out of %d tests failed\n",
|
||||
err, ksft_test_num());
|
||||
return ksft_exit_pass();
|
||||
ksft_exit_pass();
|
||||
}
|
||||
|
@ -307,5 +307,5 @@ int main(int argc, char **argv)
|
||||
if (err)
|
||||
ksft_exit_fail_msg("%d out of %d tests failed\n",
|
||||
err, ksft_test_num());
|
||||
return ksft_exit_pass();
|
||||
ksft_exit_pass();
|
||||
}
|
||||
|
@ -375,5 +375,5 @@ int main(void)
|
||||
if (err)
|
||||
ksft_exit_fail_msg("%d out of %d tests failed\n",
|
||||
err, ksft_test_num());
|
||||
return ksft_exit_pass();
|
||||
ksft_exit_pass();
|
||||
}
|
||||
|
@ -1484,7 +1484,7 @@ int main(int argc, char *argv[])
|
||||
ksft_print_header();
|
||||
|
||||
if (init_uffd())
|
||||
return ksft_exit_pass();
|
||||
ksft_exit_pass();
|
||||
|
||||
ksft_set_plan(115);
|
||||
|
||||
@ -1660,5 +1660,5 @@ int main(int argc, char *argv[])
|
||||
userfaultfd_tests();
|
||||
|
||||
close(pagemap_fd);
|
||||
return ksft_exit_pass();
|
||||
ksft_exit_pass();
|
||||
}
|
||||
|
@ -209,5 +209,5 @@ int main(int argc, char **argv)
|
||||
|
||||
close(pagemap_fd);
|
||||
|
||||
return ksft_exit_pass();
|
||||
ksft_exit_pass();
|
||||
}
|
||||
|
Reference in New Issue
Block a user