lkml.org 
[lkml]   [2022]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v6 5/7] treewide: use get_random_u32() when possible
Date
Am Dienstag, 11. Oktober 2022, 01:06:11 CEST schrieb Jason A. Donenfeld:
> The prandom_u32() function has been a deprecated inline wrapper around
> get_random_u32() for several releases now, and compiles down to the
> exact same code. Replace the deprecated wrapper with a direct call to
> the real function. The same also applies to get_random_int(), which is
> just a wrapper around get_random_u32(). This was done as a basic find
> and replace.

> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
> b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c index
> d0a7465be586..3a7aded30e8e 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
> @@ -177,7 +177,7 @@ static int brcmf_pno_set_random(struct brcmf_if *ifp,
> struct brcmf_pno_info *pi) memcpy(pfn_mac.mac, mac_addr, ETH_ALEN);
> for (i = 0; i < ETH_ALEN; i++) {
> pfn_mac.mac[i] &= mac_mask[i];
> - pfn_mac.mac[i] |= get_random_int() & ~(mac_mask[i]);
> + pfn_mac.mac[i] |= get_random_u32() & ~(mac_mask[i]);
> }
> /* Clear multi bit */
> pfn_mac.mac[0] &= 0xFE;

mac is defined as u8 mac[ETH_ALEN]; in fwil_types.h.

Eike

P.S.: CC list trimmed because of an unrelated mailer bug[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-10-11 11:15    [W:1.727 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site