libata: Convert timers to use timer_setup()
PATCH 1/1 libata: 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.
---
This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be otherwise stand-alone.
--- drivers/ata/libata-core.c | 5 ++--- drivers/ata/libata-eh.c | 4 ++-- drivers/ata/libata.h | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-)
drivers/ata/libata-core.c +2 -3
@@ -5979,9 +5979,8 @@ struct ata_port *ata_port_alloc(struct ata_host *host)INIT_LIST_HEAD (&ap->eh_done_q);init_waitqueue_head (&ap->eh_wait_q);init_completion (&ap->park_req_pending); -setup_deferrable_timer (&ap->fastdrain_timer, - ata_eh_fastdrain_timerfn, - (unsigned long )ap); +timer_setup (&ap->fastdrain_timer, ata_eh_fastdrain_timerfn, +TIMER_DEFERRABLE ); ap->cbl =ATA_CBL_NONE ;
drivers/ata/libata-eh.c +2 -2
@@ -879,9 +879,9 @@ static int ata_eh_nr_in_flight(struct ata_port *ap)return nr; } -void ata_eh_fastdrain_timerfn (unsigned long arg) +void ata_eh_fastdrain_timerfn (struct timer_list *t) { -struct ata_port *ap = (void *)arg; +struct ata_port *ap =from_timer (ap, t, fastdrain_timer);unsigned long flags;int cnt;
drivers/ata/libata.h +1 -1
@@ -154,7 +154,7 @@ extern void ata_internal_cmd_timed_out(struct ata_device *dev, u8 cmd);extern void ata_eh_acquire (struct ata_port *ap);extern void ata_eh_release (struct ata_port *ap);extern void ata_scsi_error (struct Scsi_Host *host); -extern void ata_eh_fastdrain_timerfn (unsigned long arg); +extern void ata_eh_fastdrain_timerfn (struct timer_list *t);extern void ata_qc_schedule_eh (struct ata_queued_cmd *qc);extern void ata_dev_disable (struct ata_device *dev);extern void ata_eh_detach_dev (struct ata_device *dev);
Signature · 6 lines
2.7.4 -- Kees Cook Pixel Security
Quoted 8 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.Cc Tejun Heo <[email protected]>Cc Thomas Gleixner <[email protected]>Signed-off-by Kees Cook <[email protected]>
Please feel free to route this with other timer changes.
Thanks.
Signature · 1 line
tejun
tip-bot for Kees Cook
merge botlibata: Convert timers to use timer_setup()
Commit-ID: b93ab338f7f0e39321b282d694a52736fdab172b Gitweb: https://git.kernel.org/tip/b93ab338f7f0e39321b282d694a52736fdab172b Author: Kees Cook <[email protected]> AuthorDate: Mon, 16 Oct 2017 14:56:42 -0700 Committer: Thomas Gleixner <[email protected]> CommitDate: Tue, 17 Oct 2017 17:37:37 +0200
libata: 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/ata/libata-core.c | 5 ++--- drivers/ata/libata-eh.c | 4 ++-- drivers/ata/libata.h | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-)
drivers/ata/libata-core.c +2 -3
@@ -5979,9 +5979,8 @@ struct ata_port *ata_port_alloc(struct ata_host *host)INIT_LIST_HEAD (&ap->eh_done_q);init_waitqueue_head (&ap->eh_wait_q);init_completion (&ap->park_req_pending); -setup_deferrable_timer (&ap->fastdrain_timer, - ata_eh_fastdrain_timerfn, - (unsigned long )ap); +timer_setup (&ap->fastdrain_timer, ata_eh_fastdrain_timerfn, +TIMER_DEFERRABLE ); ap->cbl =ATA_CBL_NONE ;
drivers/ata/libata-eh.c +2 -2
@@ -879,9 +879,9 @@ static int ata_eh_nr_in_flight(struct ata_port *ap)return nr; } -void ata_eh_fastdrain_timerfn (unsigned long arg) +void ata_eh_fastdrain_timerfn (struct timer_list *t) { -struct ata_port *ap = (void *)arg; +struct ata_port *ap =from_timer (ap, t, fastdrain_timer);unsigned long flags;int cnt;
drivers/ata/libata.h +1 -1
@@ -154,7 +154,7 @@ extern void ata_internal_cmd_timed_out(struct ata_device *dev, u8 cmd);extern void ata_eh_acquire (struct ata_port *ap);extern void ata_eh_release (struct ata_port *ap);extern void ata_scsi_error (struct Scsi_Host *host); -extern void ata_eh_fastdrain_timerfn (unsigned long arg); +extern void ata_eh_fastdrain_timerfn (struct timer_list *t);extern void ata_qc_schedule_eh (struct ata_queued_cmd *qc);extern void ata_dev_disable (struct ata_device *dev);extern void ata_eh_detach_dev (struct ata_device *dev);