diff mbox series

[2/2] Revert "selftests: kselftest: Fix build failure with NOLIBC"

Message ID 20240731-nolibc-scanf-v1-2-f71bcc4abb9e@weissschuh.net
State New
Headers show
Series [1/2] tools/nolibc: add support for [v]sscanf() | expand

Commit Message

Thomas Weißschuh July 31, 2024, 6:32 p.m. UTC
This reverts commit 16767502aa990cca2cb7d1372b31d328c4c85b40.

Nolibc gained support for uname(2) and sscanf(3) which are the
dependencies of ksft_min_kernel_version().

So re-enable support for ksft_min_kernel_version() under nolibc.

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

Patch

diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
index b8967b6e29d5..f0c4f62e2949 100644
--- a/tools/testing/selftests/kselftest.h
+++ b/tools/testing/selftests/kselftest.h
@@ -426,10 +426,6 @@  static inline __noreturn __printf(1, 2) void ksft_exit_skip(const char *msg, ...
 static inline int ksft_min_kernel_version(unsigned int min_major,
 					  unsigned int min_minor)
 {
-#ifdef NOLIBC
-	ksft_print_msg("NOLIBC: Can't check kernel version: Function not implemented\n");
-	return 0;
-#else
 	unsigned int major, minor;
 	struct utsname info;
 
@@ -437,7 +433,6 @@  static inline int ksft_min_kernel_version(unsigned int min_major,
 		ksft_exit_fail_msg("Can't parse kernel version\n");
 
 	return major > min_major || (major == min_major && minor >= min_minor);
-#endif
 }
 
 #endif /* __KSELFTEST_H */