Commit 69e545ed authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Shuah Khan

selftests/mm: ksft_exit functions do not return

After commit f7d5bcd3 ("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: default avatarMuhammad Usama Anjum <usama.anjum@collabora.com>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent a9c91ecd
......@@ -177,7 +177,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);
......@@ -225,7 +225,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();
}
......@@ -228,7 +228,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);
......@@ -267,5 +267,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();
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment