Skip to content
Commit f743f16c authored by Jason A. Donenfeld's avatar Jason A. Donenfeld
Browse files

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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarYury Norov <yury.norov@gmail.com>
Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
Acked-by: Heiko Carstens <hca@linux.ibm.com> # for s390
Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
parent 7e3cf084
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment