lkml.org 
[lkml]   [2024]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 3/3] selftests: kselftest: also use strerror() on nolibc
nolibc gained an implementation of strerror() recently.
Use it and drop the ifdeffery.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
tools/testing/selftests/kselftest.h | 8 --------
1 file changed, 8 deletions(-)

diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
index 541bf192e30e..f4bfe98c31e4 100644
--- a/tools/testing/selftests/kselftest.h
+++ b/tools/testing/selftests/kselftest.h
@@ -161,15 +161,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, ...)
--
2.44.0


\
 
 \ /
  Last update: 2024-05-27 18:04    [W:0.655 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site