[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20191213000657.931618-2-dima@arista.com>
Date: Fri, 13 Dec 2019 00:06:00 +0000
From: Dmitry Safonov <dima@...sta.com>
To: linux-kernel@...r.kernel.org
Cc: Dmitry Safonov <0x7f454c46@...il.com>,
Dmitry Safonov <dima@...sta.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jslaby@...e.com>,
Vasiliy Khoruzhick <vasilykh@...sta.com>,
linux-serial@...r.kernel.org
Subject: [PATCH 01/58] 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@...sta.com>
---
drivers/tty/sysrq.c | 9 +--------
1 file changed, 1 insertion(+), 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,
--
2.24.0
Powered by blists - more mailing lists