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>
Mon, 30 May 2022 07:29:02 +0000 (09:29 +0200)
commitc25c7e29be27d379a010dde9fed49755d4325df3
treed81c92bb2d125b3c70ed8ac8a0126a54a249fdf7
parent68512942c0d70d43ed6050f0a66bc1b027cbd0b4
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