diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-10-05 16:43:38 +0200 |
---|---|---|
committer | Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> | 2022-11-22 08:48:10 +0530 |
commit | 8567bb02c18ce639c53af62269c9b5cd7b1f20d9 (patch) | |
tree | ac4fef3bd49a727f4329ed42602d2c7135b528ff /drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c | |
parent | 0c25593fad5d4fcdfded0b5e0ac84df8abccc3cc (diff) |
treewide: use prandom_u32_max() when possible, part 2
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 by hand, covering things that coccinelle could not do on its own.
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Yury Norov <yury.norov@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz> # for ext2, ext4, and sbitmap
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c')
0 files changed, 0 insertions, 0 deletions