Re: [PATCH v3 net-next] net: use get_random_u{16,32,64}() where appropriate
From: Julian Calaby
Date: Mon Apr 06 2026 - 21:34:38 EST
Hi David,
On Mon, Apr 6, 2026 at 1:50 AM David Carlier <devnexen@xxxxxxxxx> wrote:
>
> Use the typed random integer helpers instead of
> get_random_bytes() when filling a single integer variable.
> The helpers return the value directly, require no pointer
> or size argument, and better express intent.
>
> Skipped sites writing into __be16 fields (netdevsim) where
> a direct assignment would trigger sparse endianness warnings.
I don't believe that endian swapping significantly affects the
randomness of the data returned, so either:
1. Do something to silence sparse (casts?)
2. Live with the endian swap overhead if they're not in the hot path.
Other than that,
Reviewed-by: Julian Calaby <julian.calaby@xxxxxxxxx>
Thanks,
--
Julian Calaby
Email: julian.calaby@xxxxxxxxx
Profile: http://www.google.com/profiles/julian.calaby/