Re: [PATCH v3 net-next] net: use get_random_u{16,32,64}() where appropriate
Matthieu Baerts <[email protected]> Mon, 6 Apr 2026 16:13:14 +0200
| Newsgroups | org.kernel.vger.linux-sctp,dev.linux.lists.mptcp,org.kernel.vger.ceph-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-wireless,org.kernel.vger.netdev |
|---|---|
| Organization | NGI0 Core |
| Message-ID | <[email protected]> |
Hi David, On 05/04/2026 17:48, David Carlier 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. Regarding the modifications in net/mptcp, it looks good to me: Reviewed-by: Matthieu Baerts (NGI0) <[email protected]> # net/mptcp > Skipped sites writing into __be16 fields (netdevsim) where > a direct assignment would trigger sparse endianness warnings. Note that the AI reviews are mentioning that auth->client_challenge from net/ceph/auth_x.c is declared as __le64, and it might then also cause sparse warnings: https://sashiko.dev/#/patchset/20260405154816.4774-1-devnexen%40gmail.com It looks like they are right: $ make C=1 net/ceph/auth_x.o net/ceph/auth_x.c:574:40: warning: incorrect type in assignment (different base types) net/ceph/auth_x.c:574:40: expected restricted __le64 [usertype] client_challenge net/ceph/auth_x.c:574:40: got unsigned long long Note that the Netdev CI currently doesn't check sparse warnings: https://github.com/linux-netdev/nipa/issues/76 Cheers, Matt -- Sponsored by the NGI0 Core fund.