Skip to contentSkip to conversation

usb: isp1301-omap: Convert timers to use timer_setup()

PATCH In review Kees Cook 3 participants 4 messages Oct 16, 2017 – Oct 17, 2017

Subsystems (2)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 usb: isp1301-omap: 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.

---
 drivers/usb/phy/phy-isp1301-omap.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/usb/phy/phy-isp1301-omap.c +5 -3
index 8a07ce63b92d..00bcc6c6db17 100644
@@ -1183,9 +1183,11 @@ static irqreturn_t isp1301_irq(int irq, void *isp)
 	return IRQ_HANDLED;
 }
 
-static void isp1301_timer(unsigned long _isp)
+static void isp1301_timer(struct timer_list *t)
 {
-	isp1301_defer_work((void *)_isp, WORK_TIMER);
+	struct isp1301 *isp = from_timer(isp, t, timer);
+
+	isp1301_defer_work(isp, WORK_TIMER);
 }
 
 /*-------------------------------------------------------------------------*/
@@ -1506,7 +1508,7 @@ isp1301_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
 	}
 
 	INIT_WORK(&isp->work, isp1301_work);
-	setup_timer(&isp->timer, isp1301_timer, (unsigned long)isp);
+	timer_setup(&isp->timer, isp1301_timer, 0);
 
 	i2c_set_clientdata(i2c, isp);
 	isp->client = i2c;
Signature · 6 lines
2.7.4


-- 
Kees Cook
Pixel Security
Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 10 lines · Kees Cook

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.

do you want me to take this through my tree?

If you wanna take through yours, here's my ack:

Signature · 1 line
balbi
#2 lore raw
Quoted 15 lines · Felipe Balbi

Hi,

Quoted 10 lines · Kees Cook

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.

Quoted 5 lines

do you want me to take this through my tree?

If you wanna take through yours, here's my ack:

I'll just take it through mine, thanks :)

greg k-h

#3 lore raw

Hi,

Quoted 12 lines · Greg Kroah-Hartman
Quoted 12 lines
Quoted 10 lines · Kees Cook

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.

Quoted 7 lines
Quoted 5 lines

do you want me to take this through my tree?

If you wanna take through yours, here's my ack:

I'll just take it through mine, thanks :)

thanks for confirming. Dropped from my queue.

Signature · 1 line
balbi