]> git.baikalelectronics.ru Git - kernel.git/commit
random: account for arch randomness in bits
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 13 Jun 2022 08:07:49 +0000 (10:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:36:27 +0000 (18:36 +0200)
commit0adecdec64d7e8fd520638d401217e591edcf2c7
tree1ce65257da0ddcf5f2259ff5eaf2ef332d21aa55
parent198ecadf584e956cae4c00559664bb7d35f09235
random: account for arch randomness in bits

commit 54a4a23d9824b75388b94405d1c6d507591ef537 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: 2aea1841598f ("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