]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
random: account for arch randomness in bits
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 7 Jun 2022 15:04:38 +0000 (17:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 09:46:42 +0000 (11:46 +0200)
commitd4bfd4858d28f0a6f7f1279b17560d30faaac5f5
tree486fa8b75769fca3984523e61c673de24a59c6ac
parent5e70c1a8eea10963080c61c3a973f525274eeb31
random: account for arch randomness in bits

commit 77fc95f8c0dc9e1f8e620ec14d2fb65028fb7adc upstream.

Rather than accounting in bytes and multiplying (shifting), we can just
account in bits and avoid the shift. The main motivation for this is
there are other patches in flux that expand this code a bit, and
avoiding the duplication of "* 8" everywhere makes things a bit clearer.

Cc: stable@vger.kernel.org
Fixes: 12e45a2a6308 ("random: credit architectural init the exact amount")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c