Re: [PATCH v2] random: add helpers for random numbers with given floor or range

From: Randy Dunlap
Date: Thu Nov 17 2022 - 11:42:05 EST




On 11/17/22 08:35, Jason A. Donenfeld wrote:
> diff --git a/drivers/char/random.c b/drivers/char/random.c
> index 6f323344d0b9..140dbd557dbc 100644
> --- a/drivers/char/random.c
> +++ b/drivers/char/random.c
> @@ -161,6 +161,8 @@ EXPORT_SYMBOL(wait_for_random_bytes);
> * u16 get_random_u16()
> * u32 get_random_u32()
> * u32 get_random_u32_below(u32 ceil)
> + * u32 get_random_u32_above(u32 floor)
> + * u32 get_random_u32_inclusive(u32 ceil, u32 floor)

floor, ceil)

> * u64 get_random_u64()
> * unsigned long get_random_long()

--
~Randy