Skip to content

Commit e84b354

Browse files
nathanchanceshuahkh
authored andcommitted
selftests/ipc: 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 5ca6110 commit e84b354

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tools/testing/selftests/ipc/msgque.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,12 @@ int main(int argc, char **argv)
198198
struct msgque_data msgque;
199199

200200
if (getuid() != 0)
201-
return ksft_exit_skip(
202-
"Please run the test as root - Exiting.\n");
201+
ksft_exit_skip("Please run the test as root - Exiting.\n");
203202

204203
msgque.key = ftok(argv[0], 822155650);
205204
if (msgque.key == -1) {
206205
printf("Can't make key: %d\n", -errno);
207-
return ksft_exit_fail();
206+
ksft_exit_fail();
208207
}
209208

210209
msgque.msq_id = msgget(msgque.key, IPC_CREAT | IPC_EXCL | 0666);
@@ -243,13 +242,13 @@ int main(int argc, char **argv)
243242
printf("Failed to test queue: %d\n", err);
244243
goto err_out;
245244
}
246-
return ksft_exit_pass();
245+
ksft_exit_pass();
247246

248247
err_destroy:
249248
if (msgctl(msgque.msq_id, IPC_RMID, NULL)) {
250249
printf("Failed to destroy queue: %d\n", -errno);
251-
return ksft_exit_fail();
250+
ksft_exit_fail();
252251
}
253252
err_out:
254-
return ksft_exit_fail();
253+
ksft_exit_fail();
255254
}

0 commit comments

Comments
 (0)