From 19db30f7343a9ee33a034cee753f33363b2fe466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20G=C3=B6rner?= <5477952+MaxG87@users.noreply.github.com> Date: Fri, 21 Oct 2022 10:12:30 +0200 Subject: [PATCH] Switch to get_random_u32 The commit a251c17aa558d8e3128a528af5cf8b9d7caae4fd in the Linux Kernel removes the deprecated wrapper `prandom_u32`. The obvious replacement is named in the commit message and used here. --- os_dep/osdep_service.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index d320e08..14cb201 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -2699,7 +2699,9 @@ u64 rtw_division64(u64 x, u64 y) inline u32 rtw_random32(void) { #ifdef PLATFORM_LINUX -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) + return get_random_u32(); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) return prandom_u32(); #elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)) u32 random_int;