From 72a9f9a445d4e296484aa5dfbfea6254d01f7cf5 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Sat, 21 Oct 2017 00:12:34 -0700 Subject: usb: usbatm: 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. Additionally corrects and on-stack timer usage. Cc: Greg Kroah-Hartman Cc: Duncan Sands Cc: "Gustavo A. R. Silva" Cc: accessrunner-general@lists.sourceforge.net Cc: linux-usb@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Allen Pais --- drivers/usb/atm/usbatm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/usb/atm/usbatm.c') diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c index 044264aa1f96..dbea28495e1d 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c @@ -989,18 +989,18 @@ static int usbatm_heavy_init(struct usbatm_data *instance) return 0; } -static void usbatm_tasklet_schedule(unsigned long data) +static void usbatm_tasklet_schedule(struct timer_list *t) { - tasklet_schedule((struct tasklet_struct *) data); + struct usbatm_channel *channel = from_timer(channel, t, delay); + + tasklet_schedule(&channel->tasklet); } static void usbatm_init_channel(struct usbatm_channel *channel) { spin_lock_init(&channel->lock); INIT_LIST_HEAD(&channel->list); - channel->delay.function = usbatm_tasklet_schedule; - channel->delay.data = (unsigned long) &channel->tasklet; - init_timer(&channel->delay); + timer_setup(&channel->delay, usbatm_tasklet_schedule, 0); } int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id, -- cgit v1.2.3