From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Willy Tarreau <w@1wt.eu>, Shuah Khan <shuah@kernel.org>
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
"Thomas Weißschuh" <linux@weissschuh.net>
Subject: [PATCH 3/3] selftests: kselftest: also use strerror() on nolibc
Date: Fri, 26 Apr 2024 13:08:58 +0200 [thread overview]
Message-ID: <20240426-nolibc-strerror-v1-3-76a4c9c5271d@weissschuh.net> (raw)
In-Reply-To: <20240426-nolibc-strerror-v1-0-76a4c9c5271d@weissschuh.net>
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
next prev parent reply other threads:[~2024-04-26 11:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-26 11:08 [PATCH 0/3] tools/nolibc: implement strerror() Thomas Weißschuh
2024-04-26 11:08 ` [PATCH 1/3] selftests/nolibc: introduce condition to run tests only on nolibc Thomas Weißschuh
2024-04-26 11:08 ` [PATCH 2/3] tools/nolibc: implement strerror() Thomas Weißschuh
2024-04-26 11:08 ` Thomas Weißschuh [this message]
2024-05-27 16:11 ` [PATCH 3/3] selftests: kselftest: also use strerror() on nolibc Thomas Weißschuh
2024-05-02 16:10 ` [PATCH 0/3] tools/nolibc: implement strerror() Thomas Weißschuh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240426-nolibc-strerror-v1-3-76a4c9c5271d@weissschuh.net \
--to=linux@weissschuh.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=w@1wt.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).