libata: Convert timers to use timer_setup()
authorKees Cook <keescook@chromium.org>
Mon, 16 Oct 2017 21:56:42 +0000 (14:56 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 17 Oct 2017 15:37:37 +0000 (17:37 +0200)
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.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: linux-ide@vger.kernel.org
Link: https://lkml.kernel.org/r/20171005004842.GA23011@beast
drivers/ata/libata-core.c
drivers/ata/libata-eh.c
drivers/ata/libata.h

index ee4c1ec9dca0ef9e51f4abf56924aab2112d9f77..b8ac4902d3122d138e050511648e6c7a81b7c938 100644 (file)
@@ -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;
 
index e4effef0c83f2bcea57bf5dda123b1c8ce4ed939..ece6fd91a947674f6f9c8cb46e46f5c4c22a1a86 100644 (file)
@@ -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;
 
index 839d487394b7be5ed8966c25571f75fe5b16a8b5..08a245b76417b14aec139f1b2f94833d7443002e 100644 (file)
@@ -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);