mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org,
	Dominik Brodowski <linux@dominikbrodowski.net>
Subject: Re: [PATCH] random: use symbolic constants for crng_init states
Date: Sun, 8 May 2022 19:23:52 +0200	[thread overview]
Message-ID: <Ynf8qMmN+AAofKMy@zx2c4.com> (raw)
In-Reply-To: <d0b220993b2fb1d306bb959707ceb374596de559.camel@perches.com>

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

  reply	other threads:[~2022-05-08 19:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-08 11:26 Jason A. Donenfeld
2022-05-08 12:57 ` Joe Perches
2022-05-08 17:23   ` Jason A. Donenfeld [this message]
2022-05-08 17:36     ` [PATCH v2] " Jason A. Donenfeld
2022-05-09  6:06       ` Dominik Brodowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Ynf8qMmN+AAofKMy@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®