]> www.infradead.org Git - users/hch/xfs.git/commitdiff
selftests: kselftest: also use strerror() on nolibc
authorThomas Weißschuh <linux@weissschuh.net>
Fri, 26 Apr 2024 11:08:58 +0000 (13:08 +0200)
committerThomas Weißschuh <linux@weissschuh.net>
Sat, 29 Jun 2024 07:44:58 +0000 (09:44 +0200)
nolibc gained an implementation of strerror() recently.
Use it and drop the ifdeffery.

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

index 76c2a6945d3e839ed0219928f34611cb3b881eaa..b8967b6e29d5037f29276dfb6a798bcee3e5f543 100644 (file)
@@ -168,15 +168,7 @@ static inline __printf(1, 2) void ksft_print_msg(const char *msg, ...)
 
 static inline void ksft_perror(const char *msg)
 {
-#ifndef NOLIBC
        ksft_print_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_print_msg("%s: %d)\n", msg, errno);
-#endif
 }
 
 static inline __printf(1, 2) void ksft_test_result_pass(const char *msg, ...)