diff options
author | Javier Martinez Canillas <javier@dowhile0.org> | 2018-02-25 22:33:54 +0100 |
---|---|---|
committer | Javier Martinez Canillas <javier@dowhile0.org> | 2018-02-25 22:34:05 +0100 |
commit | 92d096243719627a8b69c1d12a82344cd386f6cf (patch) | |
tree | 239125fb9a60eb2176a7f883f0fb8bc3d3b7e17b | |
parent | e3c38f894f146aad18e14196ca39e679f35bf19f (diff) | |
download | ldd3-92d096243719627a8b69c1d12a82344cd386f6cf.tar.gz |
misc-modules: jit: Use timer_setup() instead of init_timer()
The init_timer() function has been deprecated, use timer_setup() instead.
Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
-rw-r--r-- | misc-modules/jit.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/misc-modules/jit.c b/misc-modules/jit.c index 73baf76..ae16065 100644 --- a/misc-modules/jit.c +++ b/misc-modules/jit.c @@ -157,9 +157,9 @@ struct jit_data { }; #define JIT_ASYNC_LOOPS 5 -void jit_timer_fn(unsigned long arg) +void jit_timer_fn(struct timer_list *t) { - struct jit_data *data = (struct jit_data *)arg; + struct jit_data *data = from_timer(data, t, timer); unsigned long j = jiffies; seq_printf(data->m, "%9li %3li %i %6i %i %s\n", j, j - data->prevjiffies, in_interrupt() ? 1 : 0, @@ -184,7 +184,6 @@ int jit_timer_show(struct seq_file *m, void *v) if (!data) return -ENOMEM; - init_timer(&data->timer); init_waitqueue_head(&data->wait); /* write the first lines in the buffer */ @@ -199,8 +198,7 @@ int jit_timer_show(struct seq_file *m, void *v) data->loops = JIT_ASYNC_LOOPS; /* register the timer */ - data->timer.data = (unsigned long)data; - data->timer.function = jit_timer_fn; + timer_setup(&data->timer, jit_timer_fn, 0); data->timer.expires = j + tdelay; /* parameter */ add_timer(&data->timer); |