]> git.baikalelectronics.ru Git - kernel.git/commit
random: cleanup fractional entropy shift constants
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 13 Jan 2022 17:18:48 +0000 (18:18 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 18 Jan 2022 12:03:56 +0000 (13:03 +0100)
commitccaf653ffc2e3bab714b60323970efea8744ae93
tree9497810a353e8562075a225de531963eaddb5f3e
parentf45f6b0c7a2b41b281d10b2a3da3f22d561289b7
random: cleanup fractional entropy shift constants

The entropy estimator is calculated in terms of 1/8 bits, which means
there are various constants where things are shifted by 3. Move these
into our pool info enum with the other relevant constants. While we're
at it, move an English assertion about sizes into a proper BUILD_BUG_ON
so that the compiler can ensure this invariant.

Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/char/random.c