Re: [PATCH v6 1/7] treewide: use prandom_u32_max() when possible, part 1

2022-10-11 Thread Heiko Carstens
On Mon, Oct 10, 2022 at 05:06:07PM -0600, Jason A. Donenfeld wrote: > Rather than incurring a division or requesting too many random bytes for > the given range, use the prandom_u32_max() function, which only takes > the minimum required bytes from the RNG and avoids divisions. This was ... > Revie

[PATCH v6 1/7] treewide: use prandom_u32_max() when possible, part 1

2022-10-10 Thread Jason A. Donenfeld
Rather than incurring a division or requesting too many random bytes for the given range, use the prandom_u32_max() function, which only takes the minimum required bytes from the RNG and avoids divisions. This was done mechanically with this coccinelle script: @basic@ expression E; type T; identif