lkml.org 
[lkml]   [2022]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/7] random: remove unused reserved argument

Am Sun, Jan 16, 2022 at 05:22:32PM +0100 schrieb Jason A. Donenfeld:
> On Sun, Jan 16, 2022 at 2:45 PM Dominik Brodowski <linux@dominikbrodowski.net> wrote:
> > > @@ -1342,7 +1341,7 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min,
> > >       /* never pull more than available */
> > >       have_bytes = entropy_count >> (ENTROPY_SHIFT + 3);
> > >
> > > -     if ((have_bytes -= reserved) < 0)
> > > +     if (have_bytes < 0)
> > >               have_bytes = 0;
> > >       ibytes = min_t(size_t, ibytes, have_bytes);
> >
> > Hmm. We already WARN_ON(entropy_count < 0) a few lines below. Maybe move
> > that assertion before the assignement of have_bytes? Then, have_bytes can
> > never be lower than zero, and the code becomes even simpler. What do you
> > think?
>
> Can you send a separate patch for this that we can apply on top? It
> seems reasonable anyhow. Something like:

As you've written that patch yourself now, just take that, and feel free to
add my Reviewed-by tag.

Thanks,
Dominik

\
 
 \ /
  Last update: 2022-01-17 18:36    [W:0.085 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site