From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>, linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH v1 2/5] treewide: use get_random_{u8,u16}() when possible
Date: Thu, 06 Oct 2022 15:37:55 +0200 [thread overview]
Message-ID: <87wn9ddqdo.fsf@toke.dk> (raw)
In-Reply-To: <20221005214844.2699-3-Jason@zx2c4.com>
"Jason A. Donenfeld" <Jason@zx2c4.com> writes:
> Rather than truncate a 32-bit value to a 16-bit value or an 8-bit value,
> simply use the get_random_{u8,u16}() functions, which are faster than
> wasting the additional bytes from a 32-bit value.
>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
> crypto/testmgr.c | 8 ++++----
> drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 2 +-
> drivers/media/test-drivers/vivid/vivid-radio-rx.c | 4 ++--
> .../net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c | 2 +-
> drivers/net/hamradio/baycom_epp.c | 2 +-
> drivers/net/hamradio/hdlcdrv.c | 2 +-
> drivers/net/hamradio/yam.c | 2 +-
> drivers/net/wireguard/selftest/allowedips.c | 4 ++--
> drivers/scsi/lpfc/lpfc_hbadisc.c | 6 +++---
> lib/test_vmalloc.c | 2 +-
> net/dccp/ipv4.c | 4 ++--
> net/ipv4/datagram.c | 2 +-
> net/ipv4/ip_output.c | 2 +-
> net/ipv4/tcp_ipv4.c | 4 ++--
> net/mac80211/scan.c | 2 +-
> net/netfilter/nf_nat_core.c | 4 ++--
> net/sched/sch_cake.c | 6 +++---
> net/sched/sch_sfb.c | 2 +-
> net/sctp/socket.c | 2 +-
> 19 files changed, 31 insertions(+), 31 deletions(-)
For sch_cake:
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
next prev parent reply other threads:[~2022-10-06 13:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-05 21:48 [PATCH v1 0/5] treewide cleanup of random integer usage Jason A. Donenfeld
2022-10-05 21:48 ` [PATCH v1 1/5] treewide: use prandom_u32_max() when possible Jason A. Donenfeld
2022-10-06 9:07 ` Christoph Böhmwalder
2022-10-05 21:48 ` [PATCH v1 2/5] treewide: use get_random_{u8,u16}() " Jason A. Donenfeld
2022-10-06 13:37 ` Toke Høiland-Jørgensen [this message]
2022-10-05 21:48 ` [PATCH v1 3/5] treewide: use get_random_u32() " Jason A. Donenfeld
[not found] ` <20221006084331.4bdktc2zlvbaszym@quack3>
[not found] ` <Yz7LCyIAHC6l5mG9@zx2c4.com>
2022-10-06 13:01 ` [f2fs-dev] " Andy Shevchenko
2022-10-06 13:07 ` Jason A. Donenfeld
[not found] ` <Yz7OdfKZeGkpZSKb@ziepe.ca>
[not found] ` <CAHmME9r_vNRFFjUvqx8QkBddg_kQU=FMgpk9TqOVZdvX6zXHNg@mail.gmail.com>
2022-10-06 13:15 ` Jason Gunthorpe
2022-10-06 13:20 ` Andy Shevchenko
2022-10-06 13:38 ` Toke Høiland-Jørgensen
2022-10-12 19:16 ` Joe Perches
2022-10-12 21:29 ` David Laight
2022-10-13 1:37 ` Joe Perches
2022-10-05 21:48 ` [PATCH v1 4/5] treewide: use get_random_bytes " Jason A. Donenfeld
2022-10-05 21:48 ` [PATCH v1 5/5] prandom: remove unused functions Jason A. Donenfeld
2022-10-06 6:15 ` [PATCH v1 0/5] treewide cleanup of random integer usage Kees Cook
2022-10-06 12:58 ` Jason A. Donenfeld
2022-10-06 8:17 ` Yann Droneaud
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=87wn9ddqdo.fsf@toke.dk \
--to=toke@toke.dk \
--cc=Jason@zx2c4.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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