From: zhang jiao Date: Wed, 11 Sep 2024 04:42:30 +0000 (+0800) Subject: selftests: kselftest: Use strerror() on nolibc X-Git-Tag: v6.12-rc1~171^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a0474b8d5974e142461ac7584c996feea167bcc1;p=thirdparty%2Fkernel%2Flinux.git selftests: kselftest: Use strerror() on nolibc Nolibc gained an implementation of strerror() recently. Use it and drop the ifndef. Signed-off-by: zhang jiao Acked-by: Thomas Weißschuh Signed-off-by: Shuah Khan --- diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h index e195ec1568599..29fedf609611a 100644 --- a/tools/testing/selftests/kselftest.h +++ b/tools/testing/selftests/kselftest.h @@ -373,15 +373,7 @@ static inline __noreturn __printf(1, 2) void ksft_exit_fail_msg(const char *msg, static inline __noreturn void ksft_exit_fail_perror(const char *msg) { -#ifndef NOLIBC ksft_exit_fail_msg("%s: %s (%d)\n", msg, strerror(errno), errno); -#else - /* - * nolibc doesn't provide strerror() and it seems - * inappropriate to add one, just print the errno. - */ - ksft_exit_fail_msg("%s: %d)\n", msg, errno); -#endif } static inline __noreturn void ksft_exit_xfail(void)