]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests: kselftest: Use strerror() on nolibc
authorzhang jiao <zhangjiao2@cmss.chinamobile.com>
Wed, 11 Sep 2024 04:42:30 +0000 (12:42 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 11 Sep 2024 15:52:33 +0000 (09:52 -0600)
Nolibc gained an implementation of strerror() recently.
Use it and drop the ifndef.

Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
Acked-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/kselftest.h

index e195ec1568599a721b8fe166059603fc082a4425..29fedf609611a675f4a01dd41a17a960ab409348 100644 (file)
@@ -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)