Re: [PATCH v1 2/5] treewide: use get_random_{u8,u16}() when possible

From: Toke Høiland-Jørgensen
Date: Thu Oct 06 2022 - 09:38:09 EST


"Jason A. Donenfeld" <Jason@xxxxxxxxx> 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@xxxxxxxxx>
> ---
> 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@xxxxxxx>