From 5d6a2cc546524b2c059465a95fcae471e6dea0e9 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Wed, 11 Jan 2023 10:54:48 +0000 Subject: [PATCH] MA-20998-7 mxm_wifiex: Fix ISO C99 and later do not support implicit function declarations error Fix below build error: mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c:2910:12: error: call to undeclared function 'prandom_u32'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] *cookie = prandom_u32() | 1; ^ Change-Id: I7a314afe981b1919e4faeb946ed5fbc439496884 Signed-off-by: Zhipeng Wang --- mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c index 403b99e..e3580a9 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c @@ -2945,8 +2945,10 @@ int woal_cfg80211_mgmt_tx(struct wiphy *wiphy, ret = -ENOMEM; goto done; } -#if KERNEL_VERSION(3, 8, 0) > LINUX_VERSION_CODE +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) *cookie = random32() | 1; +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) + *cookie = get_random_u32() | 1; #else #if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE *cookie = prandom_u32() | 1;