aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKees Cook2017-10-16 16:28:51 -0700
committerGreg Kroah-Hartman2017-10-20 14:06:46 +0200
commit8c318fa93dfcd153e2f3c26cd4611238707b91cb (patch)
tree80e92e3a0fa605572eb52ec8ad07123a552ad650 /drivers
parentf0f62c67dd53ce0ed26ad2940be1dfff5c3d7bd9 (diff)
tty/sysrq: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Jiri Slaby <jslaby@suse.com> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/sysrq.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index 6ed8c47312a8..ecee833df47e 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -653,9 +653,9 @@ static void sysrq_parse_reset_sequence(struct sysrq_state *state)
state->reset_seq_version = sysrq_reset_seq_version;
}
-static void sysrq_do_reset(unsigned long _state)
+static void sysrq_do_reset(struct timer_list *t)
{
- struct sysrq_state *state = (struct sysrq_state *) _state;
+ struct sysrq_state *state = from_timer(state, t, keyreset_timer);
state->reset_requested = true;
@@ -672,7 +672,7 @@ static void sysrq_handle_reset_request(struct sysrq_state *state)
mod_timer(&state->keyreset_timer,
jiffies + msecs_to_jiffies(sysrq_reset_downtime_ms));
else
- sysrq_do_reset((unsigned long)state);
+ sysrq_do_reset(&state->keyreset_timer);
}
static void sysrq_detect_reset_sequence(struct sysrq_state *state,
@@ -908,8 +908,7 @@ static int sysrq_connect(struct input_handler *handler,
sysrq->handle.handler = handler;
sysrq->handle.name = "sysrq";
sysrq->handle.private = sysrq;
- setup_timer(&sysrq->keyreset_timer,
- sysrq_do_reset, (unsigned long)sysrq);
+ timer_setup(&sysrq->keyreset_timer, sysrq_do_reset, 0);
error = input_register_handle(&sysrq->handle);
if (error) {