]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 09:46:32 +0000 (11:46 +0200)
commit563845199476a6ded17bde9a3163101c99ede919
tree8fefd6554c33f2925bf1e3ad9bf796c3a3ec53ed
parenta88fa6c02cb18d6c58eca53f94e222672f234428
random: cleanup fractional entropy shift constants

commit 18263c4e8e62f7329f38f5eadc568751242ca89c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c