scsi: qla2xxx: Convert timers to use timer_setup()
Subsystems (2)
PATCH 1/1 scsi: qla2xxx: 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.
Cc "James E.J. Bottomley" <[email protected]>
Cc "Martin K. Petersen" <[email protected]>
Cc Thomas Gleixner <[email protected]>
Signed-off-by Kees Cook <[email protected]>
---
This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be otherwise stand-alone.
--- drivers/scsi/qla2xxx/qla_gbl.h | 6 +++--- drivers/scsi/qla2xxx/qla_init.c | 4 ++-- drivers/scsi/qla2xxx/qla_inline.h | 4 +--- drivers/scsi/qla2xxx/qla_mid.c | 2 +- drivers/scsi/qla2xxx/qla_os.c | 11 +++++------ 5 files changed, 12 insertions(+), 15 deletions(-)
drivers/scsi/qla2xxx/qla_gbl.h +3 -3
@@ -206,8 +206,8 @@ int qla24xx_async_abort_cmd(srb_t *);*/ extern struct scsi_host_template qla2xxx_driver_template;extern struct scsi_transport_template *qla2xxx_transport_vport_template; -extern void qla2x00_timer (scsi_qla_host_t *); -extern void qla2x00_start_timer (scsi_qla_host_t *,void *,unsigned long ); +extern void qla2x00_timer (struct timer_list *); +extern void qla2x00_start_timer (scsi_qla_host_t *,unsigned long );extern void qla24xx_deallocate_vp_id (scsi_qla_host_t *);extern int qla24xx_disable_vp (scsi_qla_host_t *);extern int qla24xx_enable_vp (scsi_qla_host_t *);
@@ -753,7 +753,7 @@ extern int qla82xx_restart_isp(scsi_qla_host_t *);/* IOCB related functions */ extern int qla82xx_start_scsi (srb_t *);extern void qla2x00_sp_free (void *); -extern void qla2x00_sp_timeout (unsigned long ); +extern void qla2x00_sp_timeout (struct timer_list *);extern void qla2x00_bsg_job_done (void *,int );extern void qla2x00_bsg_sp_free (void *);extern void qla2x00_start_iocbs (struct scsi_qla_host *,struct req_que *);
drivers/scsi/qla2xxx/qla_init.c +2 -2
@@ -45,9 +45,9 @@ static void qla24xx_handle_prli_done_event(struct scsi_qla_host *,/* SRB Extensions ---------------------------------------------------------- */ void -qla2x00_sp_timeout (unsigned long __data) +qla2x00_sp_timeout (struct timer_list *t) { -srb_t *sp = (srb_t *)__data; +srb_t *sp =from_timer (sp, t, u.iocb_cmd.timer);struct srb_iocb *iocb;scsi_qla_host_t *vha = sp->vha;struct req_que *req;
drivers/scsi/qla2xxx/qla_inline.h +1 -3
@@ -269,10 +269,8 @@ qla2x00_rel_sp(srb_t *sp)static inline void qla2x00_init_timer (srb_t *sp,unsigned long tmo) { -init_timer (&sp->u.iocb_cmd.timer); +timer_setup (&sp->u.iocb_cmd.timer, qla2x00_sp_timeout,0 ); sp->u.iocb_cmd.timer.expires = jiffies + tmo *HZ ; - sp->u.iocb_cmd.timer.data = (unsigned long )sp; - sp->u.iocb_cmd.timer.function = qla2x00_sp_timeout;add_timer (&sp->u.iocb_cmd.timer); sp->free = qla2x00_sp_free;if (IS_QLAFX00 (sp->vha->hw) && (sp->type ==SRB_FXIOCB_DCMD ))
drivers/scsi/qla2xxx/qla_mid.c +1 -1
@@ -487,7 +487,7 @@ qla24xx_create_vhost(struct fc_vport *fc_vport)atomic_set (&vha->loop_state,LOOP_DOWN );atomic_set (&vha->loop_down_timer,LOOP_DOWN_TIME ); -qla2x00_start_timer (vha, qla2x00_timer,WATCH_INTERVAL ); +qla2x00_start_timer (vha,WATCH_INTERVAL ); vha->req = base_vha->req; host->can_queue = base_vha->req->length +128 ;
drivers/scsi/qla2xxx/qla_os.c +5 -6
@@ -330,12 +330,10 @@ struct scsi_transport_template *qla2xxx_transport_vport_template = NULL;*/ __inline__void -qla2x00_start_timer (scsi_qla_host_t *vha,void *func,unsigned long interval) +qla2x00_start_timer (scsi_qla_host_t *vha,unsigned long interval) { -init_timer (&vha->timer); +timer_setup (&vha->timer, qla2x00_timer,0 ); vha->timer.expires = jiffies + interval *HZ ; - vha->timer.data = (unsigned long )vha; - vha->timer.function = (void (*)(unsigned long ))func;add_timer (&vha->timer); vha->timer_active =1 ; }
@@ -3245,7 +3243,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) base_vha->host->irq = ha->pdev->irq;/* Initialized the timer */ -qla2x00_start_timer (base_vha, qla2x00_timer,WATCH_INTERVAL ); +qla2x00_start_timer (base_vha,WATCH_INTERVAL );ql_dbg (ql_dbg_init, base_vha,0x00ef ,"Started qla2x00_timer with " "interval=%d.\n" ,WATCH_INTERVAL );
@@ -5994,8 +5992,9 @@ qla2x00_rst_aen(scsi_qla_host_t *vha)* Context: Interrupt ***************************************************************************/ void -qla2x00_timer (scsi_qla_host_t *vha) +qla2x00_timer (struct timer_list *t) { +scsi_qla_host_t *vha =from_timer (vha, t, timer);unsigned long cpu_flags =0 ;int start_dpc =0 ;int index;
Signature · 6 lines
2.7.4 -- Kees Cook Pixel Security