Jason A. Donenfeld f743f16c54 treewide: use get_random_{u8,u16}() when possible, part 2
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. This was done by hand,
identifying all of the places where one of the random integer functions
was used in a non-32-bit context.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Yury Norov <yury.norov@gmail.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Heiko Carstens <hca@linux.ibm.com> # for s390
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2022-10-11 17:42:58 -06:00
..
2021-12-16 19:58:07 +01:00
2021-12-13 12:04:45 -06:00
2021-01-19 12:29:26 +01:00
2022-09-14 16:46:00 +02:00
2022-10-10 12:00:45 -07:00
2022-03-28 17:29:53 -07:00
2022-03-28 17:29:53 -07:00
2022-05-11 14:40:57 +02:00
2022-07-13 14:42:11 +00:00
2022-03-10 15:58:17 +01:00