Skip to content

Commit 3bd53b2

Browse files
committed
Revert "selftests: kselftest: Fix build failure with NOLIBC"
This reverts commit 1676750. 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. Acked-by: Shuah Khan <[email protected]> Acked-by: Willy Tarreau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Thomas Weißschuh <[email protected]>
1 parent 22edf1f commit 3bd53b2

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

tools/testing/selftests/kselftest.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -444,18 +444,13 @@ static inline __noreturn __printf(1, 2) void ksft_exit_skip(const char *msg, ...
444444
static inline int ksft_min_kernel_version(unsigned int min_major,
445445
unsigned int min_minor)
446446
{
447-
#ifdef NOLIBC
448-
ksft_print_msg("NOLIBC: Can't check kernel version: Function not implemented\n");
449-
return 0;
450-
#else
451447
unsigned int major, minor;
452448
struct utsname info;
453449

454450
if (uname(&info) || sscanf(info.release, "%u.%u.", &major, &minor) != 2)
455451
ksft_exit_fail_msg("Can't parse kernel version\n");
456452

457453
return major > min_major || (major == min_major && minor >= min_minor);
458-
#endif
459454
}
460455

461456
#endif /* __KSELFTEST_H */

0 commit comments

Comments
 (0)