ahci: Convert timers to use timer_setup()
PATCH 1/1 ahci: 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. Adds a pointer back to link structure.
---
This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be otherwise stand-alone.
--- drivers/ata/ahci.h | 1 + drivers/ata/libahci.c | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-)
drivers/ata/ahci.h +1 -0
@@ -303,6 +303,7 @@ struct ahci_em_priv {unsigned long saved_activity;unsigned long activity;unsigned long led_state; +struct ata_link *link; };struct ahci_port_priv {
drivers/ata/libahci.c +6 -5
@@ -968,12 +968,12 @@ static void ahci_sw_activity(struct ata_link *link)mod_timer (&emp->timer, jiffies +msecs_to_jiffies (10 )); } -static void ahci_sw_activity_blink (unsigned long arg) +static void ahci_sw_activity_blink (struct timer_list *t) { -struct ata_link *link = (struct ata_link *)arg; +struct ahci_em_priv *emp =from_timer (emp, t, timer); +struct ata_link *link = emp->link;struct ata_port *ap = link->ap; -struct ahci_port_priv *pp = ap->private_data; -struct ahci_em_priv *emp = &pp->em_priv[link->pmp]; +unsigned long led_message = emp->led_state;u32 activity_led_state;unsigned long flags;
@@ -1020,7 +1020,8 @@ static void ahci_init_sw_activity(struct ata_link *link)/* init activity stats, setup timer */ emp->saved_activity = emp->activity =0 ; -setup_timer (&emp->timer, ahci_sw_activity_blink, (unsigned long )link); + emp->link = link; +timer_setup (&emp->timer, ahci_sw_activity_blink,0 );/* check our blink policy and set flag for link if it's enabled */ if (emp->blink_policy)
Signature · 6 lines
2.7.4 -- Kees Cook Pixel Security
Quoted 9 lines · Kees Cook
In preparation for unconditionally passing the struct
timer_listpointer to all timer callbacks, switch to using the newtimer_setup()andfrom_timer()to pass the timer pointer explicitly. Adds a pointer back to link structure.Cc Tejun Heo <[email protected]>Cc Thomas Gleixner <[email protected]>Signed-off-by Kees Cook <[email protected]>
Please feel free to route together with other timer patches.
Thanks.
Signature · 1 line
tejun
Quoted 6 lines · Tejun Heo
Quoted 5 lines · Kees Cook
In preparation for unconditionally passing the struct
timer_listpointer to all timer callbacks, switch to using the newtimer_setup()andfrom_timer()to pass the timer pointer explicitly. Adds a pointer back to link structure.
Quoted 8 lines
Quoted 4 lines
Cc Tejun Heo <[email protected]>Cc Thomas Gleixner <[email protected]>Signed-off-by Kees Cook <[email protected]>Acked-by Tejun Heo <[email protected]>Please feel free to route together with other timer patches.
Most of the timer conversions are going via the maintainer trees. Are you able to take these? If not, I can ask tglx to take them.
Thanks!
-Kees
Signature · 2 lines
Kees Cook Pixel Security
Quoted 12 lines · Kees Cook
Quoted 11 lines · Tejun Heo
Quoted 9 lines · Kees Cook
In preparation for unconditionally passing the struct
timer_listpointer to all timer callbacks, switch to using the newtimer_setup()andfrom_timer()to pass the timer pointer explicitly. Adds a pointer back to link structure.Cc Tejun Heo <[email protected]>Cc Thomas Gleixner <[email protected]>Signed-off-by Kees Cook <[email protected]>
Quoted 6 lines
Quoted 3 lines
Acked-by Tejun Heo <[email protected]>Please feel free to route together with other timer patches.
Most of the timer conversions are going via the maintainer trees. Are you able to take these? If not, I can ask tglx to take them.
Yeah, please route through timer.
Thanks.
Signature · 1 line
tejun