Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH] selftests: kselftest: Use strerror() on nolibc
@ 2024-09-11  4:42 zhangjiao2
  2024-09-11 15:36 ` Shuah Khan
  0 siblings, 1 reply; 4+ messages in thread
From: zhangjiao2 @ 2024-09-11  4:42 UTC (permalink / raw)
  To: shuah; +Cc: linux-kselftest, linux-kernel, zhang jiao

From: zhang jiao <zhangjiao2@cmss.chinamobile.com>

Nolibc gained an implementation of strerror() recently.
Use it and drop the ifndef.

Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
---
 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 e195ec156859..29fedf609611 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)
-- 
2.33.0




^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-09-11 17:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-11  4:42 [PATCH] selftests: kselftest: Use strerror() on nolibc zhangjiao2
2024-09-11 15:36 ` Shuah Khan
2024-09-11 15:44   ` Thomas Weißschuh
2024-09-11 17:41     ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox