diff options
author | Dmitry Safonov <dima@arista.com> | 2019-12-13 00:06:00 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-17 14:46:23 +0100 |
commit | f06327d15a1a6f92ca947adb2f0059425885caae (patch) | |
tree | 851db075ccc70a2c0c17a07bb61287b2ba7106a6 /drivers/tty/sysrq.c | |
parent | 4484aa800ac588a1fe2175cd53076c21067f44b4 (diff) | |
download | linux-f06327d15a1a6f92ca947adb2f0059425885caae.tar.bz2 |
sysrq: Remove sysrq_handler_registered
sysrq_toggle_support() can be called in parallel, in return calling
input_(un)register_handler(), which fortunately is safe to call
in parallel and regardless of registered/unregistered status of
sysrq_handler.
Remove sysrq_handler_registered as it doesn't have any function there
and may confuse reader about possible race.
Signed-off-by: Dmitry Safonov <dima@arista.com>
Link: https://lore.kernel.org/r/20191213000657.931618-2-dima@arista.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/sysrq.c')
-rw-r--r-- | drivers/tty/sysrq.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index 573b2055173c..1d4f317a0e42 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -967,8 +967,6 @@ static struct input_handler sysrq_handler = { .id_table = sysrq_ids, }; -static bool sysrq_handler_registered; - static inline void sysrq_register_handler(void) { int error; @@ -978,16 +976,11 @@ static inline void sysrq_register_handler(void) error = input_register_handler(&sysrq_handler); if (error) pr_err("Failed to register input handler, error %d", error); - else - sysrq_handler_registered = true; } static inline void sysrq_unregister_handler(void) { - if (sysrq_handler_registered) { - input_unregister_handler(&sysrq_handler); - sysrq_handler_registered = false; - } + input_unregister_handler(&sysrq_handler); } static int sysrq_reset_seq_param_set(const char *buffer, |