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)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 16 Feb 2022 23:00:08 +0000 (00:00 +0100)
commitc66a21451b644d1cee8df01f688c4342a293d713
tree54e4af620d2e5a0e58e9f3f30146e846324b7e11
parentfd438287358273f31c1f1827a099ae4ddcb9e179
random: make more consistent use of integer types

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>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/char/random.c
include/linux/hw_random.h
include/linux/random.h
include/trace/events/random.h