mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 04:47:05 +00:00
selftests: kselftest: Fix build failure with NOLIBC
commit16767502aa
upstream. As Mark explains ksft_min_kernel_version() can't be compiled with nolibc, it doesn't implement uname(). Fixes:6d029c25b7
("selftests/timers/posix_timers: Reimplement check_timer_distribution()") Reported-by: Mark Brown <broonie@kernel.org> Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20240412123536.GA32444@redhat.com Closes: https://lore.kernel.org/all/f0523b3a-ea08-4615-b0fb-5b504a2d39df@sirena.org.uk/ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3946c99e4e
commit
bbb2d4c71e
1 changed files with 5 additions and 0 deletions
|
@ -350,6 +350,10 @@ static inline __noreturn __printf(1, 2) int 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;
|
||||
|
||||
|
@ -357,6 +361,7 @@ 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 */
|
||||
|
|
Loading…
Reference in a new issue