[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ynf8qMmN+AAofKMy@zx2c4.com>
Date: Sun, 8 May 2022 19:23:52 +0200
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Joe Perches <joe@...ches.com>
Cc: linux-kernel@...r.kernel.org,
Dominik Brodowski <linux@...inikbrodowski.net>
Subject: Re: [PATCH] random: use symbolic constants for crng_init states
On Sun, May 08, 2022 at 05:57:18AM -0700, Joe Perches wrote:
> > diff --git a/drivers/char/random.c b/drivers/char/random.c
> []
> > @@ -72,16 +72,16 @@
> []
> > -/* Various types of waiters for crng_init->2 transition. */
> > +static enum {
> > + CRNG_EMPTY = 0, /* Little to no entropy collected */
> > + CRNG_EARLY = 1, /* At least POOL_EARLY_BITS collected */
> > + CRNG_READY = 2 /* Fully iniitalized with POOL_READY_BITS collected */
>
> typo: initialized
Thanks, will do.
>
> > enum {
> > POOL_BITS = BLAKE2S_HASH_SIZE * 8,
> > - POOL_INIT_BITS = POOL_BITS, /* No point in settling for less. */
> > - POOL_FAST_INIT_BITS = POOL_INIT_BITS / 2
> > + POOL_READY_BITS = POOL_BITS, /* When crng_init->CRNG_READY */
> > + POOL_EARLY_BITS = POOL_READY_BITS / 2 /* When crng_init->CRNG_EARLY */
>
> Seems odd to use a divisor with an enum
Why? The constants are defined in terms of other constants.
Jason
Powered by blists - more mailing lists