OSDN Git Service

random: convert get_random_int/long into get_random_u32/u64
authorJason A. Donenfeld <Jason@zx2c4.com>
Sun, 22 Jan 2017 15:34:08 +0000 (16:34 +0100)
committer0ranko0P <ranko0p@outlook.com>
Wed, 4 Dec 2019 13:37:51 +0000 (21:37 +0800)
commit519a10413a6e9bb5f8b248616ba4682d16a2d6c5
tree8c72ce263ae28df10bc5b3352e3596622c330f38
parent16f35be142105cb7de63bd68e238d196eaee84be
random: convert get_random_int/long into get_random_u32/u64

Many times, when a user wants a random number, he wants a random number
of a guaranteed size. So, thinking of get_random_int and get_random_long
in terms of get_random_u32 and get_random_u64 makes it much easier to
achieve this. It also makes the code simpler.

On 32-bit platforms, get_random_int and get_random_long are both aliased
to get_random_u32. On 64-bit platforms, int->u32 and long->u64.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
drivers/char/random.c
include/linux/random.h