diff --git a/drivers/char/random.c b/drivers/char/random.c index 00b50ccc9fae6bf09ebbe85cc6c49d48b53ab929..04a7b401736ba198b7bfe35a48c85e22ae2b0825 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -205,7 +205,7 @@ static void __cold process_random_ready_list(void) * * There are a few exported interfaces for use by other drivers: * - * void get_random_bytes(void *buf, size_t len) + * void get_random_bytes(void *buf, int len) * u32 get_random_u32() * u64 get_random_u64() * unsigned int get_random_int() @@ -442,10 +442,10 @@ static void _get_random_bytes(void *buf, size_t len) * wait_for_random_bytes() should be called and return 0 at least once * at any point prior. */ -void get_random_bytes(void *buf, size_t len) +void get_random_bytes(void *buf, int len) { warn_unseeded_randomness(); - _get_random_bytes(buf, len); + _get_random_bytes(buf, (size_t) len); } EXPORT_SYMBOL(get_random_bytes); diff --git a/include/linux/random.h b/include/linux/random.h index 917470c4490ac9015421d5bccc717ca6f0366e3d..7b374cc82cb34fda6c1ca49eb42578f959ac4efa 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -28,7 +28,7 @@ static inline void add_latent_entropy(void) static inline void add_latent_entropy(void) { } #endif -void get_random_bytes(void *buf, size_t len); +void get_random_bytes(void *buf, int len); size_t __must_check get_random_bytes_arch(void *buf, size_t len); u32 get_random_u32(void); u64 get_random_u64(void); @@ -75,7 +75,7 @@ int unregister_random_ready_notifier(struct notifier_block *nb); static inline int get_random_bytes_wait(void *buf, size_t nbytes) { int ret = wait_for_random_bytes(); - get_random_bytes(buf, nbytes); + get_random_bytes(buf, (int) nbytes); return ret; }