This is a note to let you know that I've just added the patch titled random: convert to ENTROPY_BITS for better code readability to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: random-convert-to-entropy_bits-for-better-code-readability.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Fri Jun 17 08:58:56 AM CEST 2022 From: Yangtao Li <tiny.windzz@xxxxxxxxx> Date: Fri, 7 Jun 2019 14:25:14 -0400 Subject: random: convert to ENTROPY_BITS for better code readability From: Yangtao Li <tiny.windzz@xxxxxxxxx> commit 12faac30d157970fdbfa171bbeb1fb88350303b1 upstream. Signed-off-by: Yangtao Li <tiny.windzz@xxxxxxxxx> Link: https://lore.kernel.org/r/20190607182517.28266-2-tiny.windzz@xxxxxxxxx Signed-off-by: Theodore Ts'o <tytso@xxxxxxx> Signed-off-by: Jason A. Donenfeld <Jason@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/char/random.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -762,7 +762,7 @@ retry: if (entropy_bits < 128) return; crng_reseed(&primary_crng, r); - entropy_bits = r->entropy_count >> ENTROPY_SHIFT; + entropy_bits = ENTROPY_BITS(r); } } } @@ -1397,8 +1397,7 @@ retry: goto retry; trace_debit_entropy(r->name, 8 * ibytes); - if (ibytes && - (r->entropy_count >> ENTROPY_SHIFT) < random_write_wakeup_bits) { + if (ibytes && ENTROPY_BITS(r) < random_write_wakeup_bits) { wake_up_interruptible(&random_write_wait); kill_fasync(&fasync, SIGIO, POLL_OUT); } Patches currently in stable-queue which might be from tiny.windzz@xxxxxxxxx are queue-4.19/random-fix-typo-in-add_timer_randomness.patch queue-4.19/random-add-and-use-pr_fmt.patch queue-4.19/random-convert-to-entropy_bits-for-better-code-readability.patch queue-4.19/random-remove-unnecessary-unlikely.patch queue-4.19/random-remove-some-dead-code-of-poolinfo.patch