From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Rolf Eike Beer <eike-kernel@sf-tec.de>
Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev,
Andrew Morton <akpm@linux-foundation.org>,
"David S . Miller" <davem@davemloft.net>,
kernel-janitors@vger.kernel.org, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH v6 5/7] treewide: use get_random_u32() when possible
Date: Tue, 11 Oct 2022 13:20:41 -0600 [thread overview]
Message-ID: <Y0XCCSpBVcfg/C/7@zx2c4.com> (raw)
In-Reply-To: <2659449.sfTDpz5f83@eto.sf-tec.de>
On Tue, Oct 11, 2022 at 11:14:44AM +0200, Rolf Eike Beer wrote:
> 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
Nice catch, thanks. Will remove to the get_random_{u16,u8} commit.
next prev parent reply other threads:[~2022-10-11 19:20 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-10 23:06 [PATCH v6 0/7] treewide cleanup of random integer usage Jason A. Donenfeld
2022-10-10 23:06 ` [PATCH v6 1/7] treewide: use prandom_u32_max() when possible, part 1 Jason A. Donenfeld
2022-10-11 9:58 ` Heiko Carstens
2022-10-10 23:06 ` [PATCH v6 2/7] treewide: use prandom_u32_max() when possible, part 2 Jason A. Donenfeld
2022-10-10 23:06 ` [PATCH v6 3/7] treewide: use get_random_{u8,u16}() when possible, part 1 Jason A. Donenfeld
2022-10-11 1:18 ` Elliott, Robert (Servers)
2022-10-11 3:00 ` Jason A. Donenfeld
2022-10-10 23:06 ` [PATCH v6 4/7] treewide: use get_random_{u8,u16}() when possible, part 2 Jason A. Donenfeld
2022-10-11 9:59 ` Heiko Carstens
2022-10-10 23:06 ` [PATCH v6 5/7] treewide: use get_random_u32() when possible Jason A. Donenfeld
2022-10-11 9:14 ` Rolf Eike Beer
2022-10-11 19:20 ` Jason A. Donenfeld [this message]
2022-10-11 10:00 ` Heiko Carstens
2022-10-13 9:25 ` Rolf Eike Beer
2022-10-13 10:16 ` Florian Westphal
2022-10-13 11:40 ` Rolf Eike Beer
2022-10-13 16:21 ` Jason A. Donenfeld
2022-10-10 23:06 ` [PATCH v6 6/7] treewide: use get_random_bytes() " Jason A. Donenfeld
2022-10-10 23:06 ` [PATCH v6 7/7] prandom: remove unused functions Jason A. Donenfeld
2022-10-11 23:01 ` [PATCH v6 0/7] treewide cleanup of random integer usage Jakub Kicinski
2022-10-17 11:59 ` liulongfang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y0XCCSpBVcfg/C/7@zx2c4.com \
--to=jason@zx2c4.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=eike-kernel@sf-tec.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=patches@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).