Search Linux Wireless

Re: [PATCH v6 5/7] treewide: use get_random_u32() when possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux