scsi: qla4xxx: Convert timers to use timer_setup()
Subsystems (2)
PATCH 1/1 scsi: qla4xxx: 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]>
Signed-off-by Kees Cook <[email protected]>
--- drivers/scsi/qla4xxx/ql4_os.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/scsi/qla4xxx/ql4_os.c +6 -6
@@ -3955,16 +3955,15 @@ void qla4xxx_update_session_conn_param(struct scsi_qla_host *ha,/* * Timer routines */ +static void qla4xxx_timer (struct timer_list *t); -static void qla4xxx_start_timer (struct scsi_qla_host *ha,void *func, +static void qla4xxx_start_timer (struct scsi_qla_host *ha,unsigned long interval) {DEBUG (printk ("scsi: %s: Starting timer thread for adapter %d\n" , __func__, ha->host->host_no)); -init_timer (&ha->timer); +timer_setup (&ha->timer, qla4xxx_timer,0 ); ha->timer.expires = jiffies + interval *HZ ; - ha->timer.data = (unsigned long )ha; - ha->timer.function = (void (*)(unsigned long ))func;add_timer (&ha->timer); ha->timer_active =1 ; }
@@ -4508,8 +4507,9 @@ static void qla4xxx_check_relogin_flash_ddb(struct iscsi_cls_session *cls_sess)* qla4xxx_timer - checks every second for work to do. * @ha: Pointer to host adapter structure. **/ -static void qla4xxx_timer (struct scsi_qla_host *ha) +static void qla4xxx_timer (struct timer_list *t) { +struct scsi_qla_host *ha =from_timer (ha, t, timer);int start_dpc =0 ;uint16_t w;
@@ -8805,7 +8805,7 @@ static int qla4xxx_probe_adapter(struct pci_dev *pdev, ha->isp_ops->enable_intrs (ha);/* Start timer thread. */ -qla4xxx_start_timer (ha, qla4xxx_timer,1 ); +qla4xxx_start_timer (ha,1 );set_bit (AF_INIT_DONE , &ha->flags);
Signature · 6 lines
2.7.4 -- Kees Cook Pixel Security
Kees,
Quoted 3 lines
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.
Cavium folks (for good measure): Please review!
Reviewed-by Martin K. Petersen <[email protected]>
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Quoted 64 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 "James E.J. Bottomley" <[email protected]>Cc "Martin K. Petersen" <[email protected]>Signed-off-by Kees Cook <[email protected]>---
drivers/scsi/qla4xxx/ql4_os.c| 12 ++++++------1 file changed, 6 insertions(+), 6 deletions(-)drivers/scsi/qla4xxx/ql4_os.c +3
-4@@ -3955,16 +3955,15 @@ void qla4xxx_update_session_conn_param(structscsi_qla_host *ha,/* * Timer routines */ +static void qla4xxx_timer(struct timer_list *t); -static void qla4xxx_start_timer(struct scsi_qla_host *ha, void *func, +static void qla4xxx_start_timer (struct scsi_qla_host *ha,unsigned long interval) {DEBUG (printk ("scsi: %s: Starting timer thread for adapter %d\n" , __func__, ha->host->host_no)); -init_timer (&ha->timer); +timer_setup (&ha->timer, qla4xxx_timer,0 ); ha->timer.expires = jiffies + interval *HZ ; - ha->timer.data = (unsigned long )ha; - ha->timer.function = (void (*)(unsigned long ))func;add_timer (&ha->timer); ha->timer_active =1 ;}
drivers/scsi/qla4xxx/ql4_os.c +3
-2@@ -4508,8 +4507,9 @@ static void qla4xxx_check_relogin_flash_ddb(structiscsi_cls_session *cls_sess) * qla4xxx_timer - checks every second for work to do. * @ha: Pointer to host adapter structure. **/ -static void qla4xxx_timer (struct scsi_qla_host *ha) +static void qla4xxx_timer (struct timer_list *t) { +struct scsi_qla_host *ha =from_timer (ha, t, timer);int start_dpc =0 ;uint16_t w;@@ -8805,7 +8805,7 @@ static int qla4xxx_probe_adapter(struct pci_dev *pdev, ha->isp_ops->enable_intrs (ha);/* Start timer thread. */ -qla4xxx_start_timer (ha, qla4xxx_timer,1 ); +qla4xxx_start_timer (ha,1 );set_bit (AF_INIT_DONE , &ha->flags);Signature · 2 lines
-- 2.7.4
Acked-by Manish Rangankar <[email protected]>