Skip to content

Commit eb116f8

Browse files
nathanchanceshuahkh
authored andcommitted
selftests: kselftest: Make ksft_exit functions return void instead of int
Commit f7d5bcd ("selftests: kselftest: Mark functions that unconditionally call exit() as __noreturn") marked functions that call exit() as __noreturn but it did not change the return type of these functions from 'void' to 'int' like it should have (since a noreturn function by definition cannot return an integer because it does not return...) because there were many tests that return the result of the ksft_exit functions, even though it has never been used due to calling exit(). Now that all uses of 'return ksft_exit...()' have been cleaned up properly, change the types of the ksft_exit...() functions to void to match their __noreturn nature. 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 8860d86 commit eb116f8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tools/testing/selftests/kselftest.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,13 +329,13 @@ void ksft_test_result_code(int exit_code, const char *test_name,
329329
break; \
330330
} } while (0)
331331

332-
static inline __noreturn int ksft_exit_pass(void)
332+
static inline __noreturn void ksft_exit_pass(void)
333333
{
334334
ksft_print_cnts();
335335
exit(KSFT_PASS);
336336
}
337337

338-
static inline __noreturn int ksft_exit_fail(void)
338+
static inline __noreturn void ksft_exit_fail(void)
339339
{
340340
ksft_print_cnts();
341341
exit(KSFT_FAIL);
@@ -362,7 +362,7 @@ static inline __noreturn int ksft_exit_fail(void)
362362
ksft_cnt.ksft_xfail + \
363363
ksft_cnt.ksft_xskip)
364364

365-
static inline __noreturn __printf(1, 2) int ksft_exit_fail_msg(const char *msg, ...)
365+
static inline __noreturn __printf(1, 2) void ksft_exit_fail_msg(const char *msg, ...)
366366
{
367367
int saved_errno = errno;
368368
va_list args;
@@ -390,19 +390,19 @@ static inline __noreturn void ksft_exit_fail_perror(const char *msg)
390390
#endif
391391
}
392392

393-
static inline __noreturn int ksft_exit_xfail(void)
393+
static inline __noreturn void ksft_exit_xfail(void)
394394
{
395395
ksft_print_cnts();
396396
exit(KSFT_XFAIL);
397397
}
398398

399-
static inline __noreturn int ksft_exit_xpass(void)
399+
static inline __noreturn void ksft_exit_xpass(void)
400400
{
401401
ksft_print_cnts();
402402
exit(KSFT_XPASS);
403403
}
404404

405-
static inline __noreturn __printf(1, 2) int ksft_exit_skip(const char *msg, ...)
405+
static inline __noreturn __printf(1, 2) void ksft_exit_skip(const char *msg, ...)
406406
{
407407
int saved_errno = errno;
408408
va_list args;

0 commit comments

Comments
 (0)