[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHmME9rie8h9J=R9UkRQgsNntRKNqwqbQx=LY8wiOS0V-WYV_A@mail.gmail.com>
Date: Mon, 21 Feb 2022 16:22:32 +0100
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Eric Biggers <ebiggers@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Dominik Brodowski <linux@...inikbrodowski.net>,
"Theodore Ts'o" <tytso@....edu>
Subject: Re: [PATCH 1/3] random: unify early init crng load accounting
On Mon, Feb 21, 2022 at 6:50 AM Eric Biggers <ebiggers@...nel.org> wrote:
>
> On Sun, Feb 13, 2022 at 12:10:20AM +0100, Jason A. Donenfeld wrote:
> > -static size_t crng_fast_load(const void *cp, size_t len)
> > +static size_t crng_pre_init_inject(const void *cp, size_t len,
> > + bool fast, bool account)
>
> This would be a good chance to rename 'cp' to something more usual, like 'in'.
I'll do that. By the way, if you feel inclined to clean up other
instances of 'cp' and other odd variable names, feel free to send a
patch devoted to that.
>
> Also, there's still a mention of "crng_{fast,slow}_load" in crng_make_state().
Nice catch, will fix.
>
> > + const u8 *src = cp;
> > +
> > + if (fast) {
> > + if (!spin_trylock_irqsave(&base_crng.lock, flags))
> > + return 0;
> > + } else
> > + spin_lock_irqsave(&base_crng.lock, flags);
>
> Nit: the kernel coding style requires braces around the else clause here.
Not the biggest fan of this one, but will do.
Jason
Powered by blists - more mailing lists