]> git.baikalelectronics.ru Git - kernel.git/commit
random: make more consistent use of integer types
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 9 Feb 2022 13:43:25 +0000 (14:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 May 2022 07:29:05 +0000 (09:29 +0200)
commit25b2aa518420a164e59f4b3c67d6acb518248355
treef0df0ee71f247e5097af6de9e9e27db7290feea5
parent4d4704d4d0327310ede34d8d9a8a4d9e3eb74111
random: make more consistent use of integer types

commit f2515990c0b8e77aed08d83114116f3219b616c7 upstream.

We've been using a flurry of int, unsigned int, size_t, and ssize_t.
Let's unify all of this into size_t where it makes sense, as it does in
most places, and leave ssize_t for return values with possible errors.

In addition, keeping with the convention of other functions in this
file, functions that are dealing with raw bytes now take void *
consistently instead of a mix of that and u8 *, because much of the time
we're actually passing some other structure that is then interpreted as
bytes by the function.

We also take the opportunity to fix the outdated and incorrect comment
in get_random_bytes_arch().

Cc: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Reviewed-by: Jann Horn <jannh@google.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c
include/linux/hw_random.h
include/linux/random.h
include/trace/events/random.h