random: introduce drain_entropy() helper to declutter crng_reseed()
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 11 Feb 2022 11:19:49 +0000 (12:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 09:46:34 +0000 (11:46 +0200)
commit65419e900306cdcdfb4354445e6a1f54161757a1
treee874cd0137f798d0a550686c923df6afe135eb09
parente0a5363f51f501731df3a3b69849f0c2b6fbf34e
random: introduce drain_entropy() helper to declutter crng_reseed()

commit 246c03dd899164d0186b6d685d6387f228c28d93 upstream.

In preparation for separating responsibilities, break out the entropy
count management part of crng_reseed() into its own function.

No functional changes.

Cc: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c