Skip to content

Commit 69e545e

Browse files
nathanchanceshuahkh
authored andcommitted
selftests/mm: ksft_exit functions do 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_...(), 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 <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent a9c91ec commit 69e545e

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

tools/testing/selftests/mm/compaction_test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ int main(int argc, char **argv)
177177
ksft_print_header();
178178

179179
if (prereq() || geteuid())
180-
return ksft_exit_skip("Prerequisites unsatisfied\n");
180+
ksft_exit_skip("Prerequisites unsatisfied\n");
181181

182182
ksft_set_plan(1);
183183

@@ -225,7 +225,7 @@ int main(int argc, char **argv)
225225
}
226226

227227
if (check_compaction(mem_free, hugepage_size) == 0)
228-
return ksft_exit_pass();
228+
ksft_exit_pass();
229229

230-
return ksft_exit_fail();
230+
ksft_exit_fail();
231231
}

tools/testing/selftests/mm/cow.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1779,5 +1779,5 @@ int main(int argc, char **argv)
17791779
if (err)
17801780
ksft_exit_fail_msg("%d out of %d tests failed\n",
17811781
err, ksft_test_num());
1782-
return ksft_exit_pass();
1782+
ksft_exit_pass();
17831783
}

tools/testing/selftests/mm/gup_longterm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,5 +456,5 @@ int main(int argc, char **argv)
456456
if (err)
457457
ksft_exit_fail_msg("%d out of %d tests failed\n",
458458
err, ksft_test_num());
459-
return ksft_exit_pass();
459+
ksft_exit_pass();
460460
}

tools/testing/selftests/mm/gup_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ int main(int argc, char **argv)
228228
break;
229229
}
230230
ksft_test_result_skip("Please run this test as root\n");
231-
return ksft_exit_pass();
231+
ksft_exit_pass();
232232
}
233233

234234
p = mmap(NULL, size, PROT_READ | PROT_WRITE, flags, filed, 0);
@@ -267,5 +267,5 @@ int main(int argc, char **argv)
267267

268268
free(tid);
269269

270-
return ksft_exit_pass();
270+
ksft_exit_pass();
271271
}

tools/testing/selftests/mm/ksm_functional_tests.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,5 +646,5 @@ int main(int argc, char **argv)
646646
if (err)
647647
ksft_exit_fail_msg("%d out of %d tests failed\n",
648648
err, ksft_test_num());
649-
return ksft_exit_pass();
649+
ksft_exit_pass();
650650
}

tools/testing/selftests/mm/madv_populate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,5 +307,5 @@ int main(int argc, char **argv)
307307
if (err)
308308
ksft_exit_fail_msg("%d out of %d tests failed\n",
309309
err, ksft_test_num());
310-
return ksft_exit_pass();
310+
ksft_exit_pass();
311311
}

tools/testing/selftests/mm/mkdirty.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,5 +375,5 @@ int main(void)
375375
if (err)
376376
ksft_exit_fail_msg("%d out of %d tests failed\n",
377377
err, ksft_test_num());
378-
return ksft_exit_pass();
378+
ksft_exit_pass();
379379
}

tools/testing/selftests/mm/pagemap_ioctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ int main(int argc, char *argv[])
14841484
ksft_print_header();
14851485

14861486
if (init_uffd())
1487-
return ksft_exit_pass();
1487+
ksft_exit_pass();
14881488

14891489
ksft_set_plan(115);
14901490

@@ -1660,5 +1660,5 @@ int main(int argc, char *argv[])
16601660
userfaultfd_tests();
16611661

16621662
close(pagemap_fd);
1663-
return ksft_exit_pass();
1663+
ksft_exit_pass();
16641664
}

tools/testing/selftests/mm/soft-dirty.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,5 @@ int main(int argc, char **argv)
209209

210210
close(pagemap_fd);
211211

212-
return ksft_exit_pass();
212+
ksft_exit_pass();
213213
}

0 commit comments

Comments
 (0)