]> git.baikalelectronics.ru Git - kernel.git/commit
random: replace custom notifier chain with standard one
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 1 Mar 2022 19:03:49 +0000 (20:03 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sun, 13 Mar 2022 01:00:56 +0000 (18:00 -0700)
commit559f3fd1c0ba6561243ceaa5ebf2542d1b3b0a0c
treeea7d9e993383b44e483fcd44fc85df78222f8af8
parent63b5f53bc6ac764bcc51977814d810dd0f59d2a2
random: replace custom notifier chain with standard one

We previously rolled our own randomness readiness notifier, which only
has two users in the whole kernel. Replace this with a more standard
atomic notifier block that serves the same purpose with less code. Also
unexport the symbols, because no modules use it, only unconditional
builtins. The only drawback is that it's possible for a notification
handler returning the "stop" code to prevent further processing, but
given that there are only two users, and that we're unexporting this
anyway, that doesn't seem like a significant drawback for the
simplification we receive here.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/char/random.c
include/linux/random.h
lib/random32.c
lib/vsprintf.c