]> git.baikalelectronics.ru Git - kernel.git/commit
random: remove mostly unused async readiness notifier
authorJason A. Donenfeld <Jason@zx2c4.com>
Sun, 15 May 2022 13:06:18 +0000 (15:06 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Thu, 19 May 2022 14:54:15 +0000 (16:54 +0200)
commit8dcd03f85ab9a39ca2125d27b6b8057cf767d7ba
tree5abaea08a755fac6972811c2ff2b098fdcbe6d1a
parent606a50dac952dac219fcb0c78b680133161ac2d6
random: remove mostly unused async readiness notifier

The register_random_ready_notifier() notifier is somewhat complicated,
and was already recently rewritten to use notifier blocks. It is only
used now by one consumer in the kernel, vsprintf.c, for which the async
mechanism is really overly complex for what it actually needs. This
commit removes register_random_ready_notifier() and unregister_random_
ready_notifier(), because it just adds complication with little utility,
and changes vsprintf.c to just check on `!rng_is_initialized() &&
!rng_has_arch_random()`, which will eventually be true. Performance-
wise, that code was already using a static branch, so there's basically
no overhead at all to this change.

Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Acked-by: Petr Mladek <pmladek@suse.com> # for vsprintf.c
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/char/random.c
include/linux/random.h
lib/vsprintf.c