diff --git a/drivers/char/random.c b/drivers/char/random.c index e77c9233c50b..550cf8894ee6 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -445,7 +445,7 @@ 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); @@ -589,7 +589,7 @@ int __cold random_prepare_cpu(unsigned int cpu) * use. Use get_random_bytes() instead. It returns the number of * bytes filled in. */ -size_t __must_check get_random_bytes_arch(void *buf, size_t len) +int __must_check get_random_bytes_arch(void *buf, int len) { size_t left = len; u8 *p = buf; @@ -864,7 +864,7 @@ int __init random_init(const char *command_line) * the entropy pool having similar initial state across largely * identical devices. */ -void add_device_randomness(const void *buf, size_t len) +void add_device_randomness(const void *buf, unsigned int len) { unsigned long entropy = random_get_entropy(); unsigned long flags; diff --git a/include/linux/random.h b/include/linux/random.h index 5d04058c494c..9246d87767fd 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -12,7 +12,7 @@ struct notifier_block; -void add_device_randomness(const void *buf, size_t len); +void add_device_randomness(const void *buf, unsigned int len); void add_bootloader_randomness(const void *buf, size_t len); void add_input_randomness(unsigned int type, unsigned int code, unsigned int value) __latent_entropy; @@ -28,8 +28,8 @@ static inline void add_latent_entropy(void) static inline void add_latent_entropy(void) { } #endif -void get_random_bytes(void *buf, size_t len); -size_t __must_check get_random_bytes_arch(void *buf, size_t len); +void get_random_bytes(void *buf, int len); +int __must_check get_random_bytes_arch(void *buf, int len); u32 get_random_u32(void); u64 get_random_u64(void); static inline unsigned int get_random_int(void)