From 87c1d2d373c2dfc9993f09c3cfd69cf2c3347b20 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 17 Oct 2017 21:10:19 -0700 Subject: lightnvm: 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: Matias Bjorling Cc: linux-block@vger.kernel.org Signed-off-by: Kees Cook --- drivers/lightnvm/pblk-rl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/lightnvm/pblk-rl.c') diff --git a/drivers/lightnvm/pblk-rl.c b/drivers/lightnvm/pblk-rl.c index abae31fd434e..dacc71922260 100644 --- a/drivers/lightnvm/pblk-rl.c +++ b/drivers/lightnvm/pblk-rl.c @@ -158,9 +158,9 @@ int pblk_rl_max_io(struct pblk_rl *rl) return rl->rb_max_io; } -static void pblk_rl_u_timer(unsigned long data) +static void pblk_rl_u_timer(struct timer_list *t) { - struct pblk_rl *rl = (struct pblk_rl *)data; + struct pblk_rl *rl = from_timer(rl, t, u_timer); /* Release user I/O state. Protect from GC */ smp_store_release(&rl->rb_user_active, 0); @@ -202,7 +202,7 @@ void pblk_rl_init(struct pblk_rl *rl, int budget) atomic_set(&rl->rb_gc_cnt, 0); atomic_set(&rl->rb_space, -1); - setup_timer(&rl->u_timer, pblk_rl_u_timer, (unsigned long)rl); + timer_setup(&rl->u_timer, pblk_rl_u_timer, 0); rl->rb_user_active = 0; rl->rb_gc_active = 0; -- cgit v1.2.3