Skip to contentSkip to conversation

use setup_timer() helper function.

PATCH In review Allen Pais 2 participants 15 messages Sep 22, 2017

Subsystems (11)
lore
Share & tools
lore

Allen Pais

author
#0 lore raw

cover use setup_timer() helper function.

This series uses setup_timer() helper function. The series addresses the files under drivers/scsi/*.

Allen Pais (13):
scsi: sym53c8xx: use setup_timer() helper.
scsi: qla2xxx: use setup_timer() helper.
scsi: esas2r: use setup_timer() helper.
scsi: bnx2i: use setup_timer() helper.
scsi: arcmsr: use setup_timer() helper.
scsi: be2iscsi: use setup_timer() helper.
scsi: qla4xxx: use setup_timer() helper.
scsi: ncr53c8xx: use setup_timer() helper.
scsi: arm: fas216: use setup_timer() helper.
scsi: libiscsi: use setup_timer() helper.
scsi: dc395x: use setup_timer() helper.
scsi: qla2xxx: use setup_timer() helper.
scsi: bfa: use setup_timer() helper.

 drivers/scsi/arcmsr/arcmsr_hba.c    | 10 ++++------
 drivers/scsi/arm/fas216.c           |  4 +---
 drivers/scsi/be2iscsi/be_main.c     |  5 ++---
 drivers/scsi/bfa/bfad.c             |  4 +---
 drivers/scsi/bnx2i/bnx2i_iscsi.c    | 14 +++++---------
 drivers/scsi/dc395x.c               |  4 +---
 drivers/scsi/esas2r/esas2r_main.c   |  4 +---
 drivers/scsi/libiscsi.c             |  5 ++---
 drivers/scsi/ncr53c8xx.c            |  4 +---
 drivers/scsi/qla2xxx/qla_inline.h   |  5 ++---
 drivers/scsi/qla2xxx/qla_os.c       |  5 ++---
 drivers/scsi/qla4xxx/ql4_os.c       |  5 ++---
 drivers/scsi/sym53c8xx_2/sym_glue.c |  4 +---
 13 files changed, 25 insertions(+), 48 deletions(-)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/13 scsi: sym53c8xx: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/scsi/sym53c8xx_2/sym_glue.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/sym53c8xx_2/sym_glue.c +1 -3
index d32e3ba..285397d 100644
@@ -1351,9 +1351,7 @@ static struct Scsi_Host *sym_attach(struct scsi_host_template *tpnt, int unit,
 	/*
 	 *  Start the timer daemon
 	 */
-	init_timer(&np->s.timer);
-	np->s.timer.data     = (unsigned long) np;
-	np->s.timer.function = sym53c8xx_timer;
+	setup_timer(&np->s.timer, sym53c8xx_timer, (unsigned long)np);
 	np->s.lasttime=0;
 	sym_timer (np);
 
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH 2/13 scsi: qla2xxx: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/scsi/qla2xxx/qla_inline.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_inline.h +2 -3
index 9a2c86e..34cdb5d 100644
@@ -269,10 +269,9 @@ 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);
+	setup_timer(&sp->u.iocb_cmd.timer, qla2x00_sp_timeout,
+		    (unsigned long)sp);
 	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))
Signature · 1 line
2.7.4
author
#3 lore raw

PATCH 3/13 scsi: esas2r: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/scsi/esas2r/esas2r_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/esas2r/esas2r_main.c +1 -3
index 81f226b..590db6d 100644
@@ -1635,10 +1635,8 @@ static void esas2r_timer_callback(unsigned long context);
 
 void esas2r_kickoff_timer(struct esas2r_adapter *a)
 {
-	init_timer(&a->timer);
 
-	a->timer.function = esas2r_timer_callback;
-	a->timer.data = (unsigned long)a;
+	setup_timer(&a->timer, esas2r_timer_callback, (unsigned long)a);
 	a->timer.expires = jiffies +
 			   msecs_to_jiffies(100);
 
Signature · 1 line
2.7.4
author
#4 lore raw

PATCH 4/13 scsi: bnx2i: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/scsi/bnx2i/bnx2i_iscsi.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/scsi/bnx2i/bnx2i_iscsi.c +5 -9
index 03c104b..bffc7e9 100644
@@ -1729,10 +1729,8 @@ static int bnx2i_tear_down_conn(struct bnx2i_hba *hba,
 	}
 
 	ep->state = EP_STATE_CLEANUP_START;
-	init_timer(&ep->ofld_timer);
+	setup_timer(&ep->ofld_timer, bnx2i_ep_ofld_timer, (unsigned long)ep);
 	ep->ofld_timer.expires = hba->conn_ctx_destroy_tmo + jiffies;
-	ep->ofld_timer.function = bnx2i_ep_ofld_timer;
-	ep->ofld_timer.data = (unsigned long) ep;
 	add_timer(&ep->ofld_timer);
 
 	bnx2i_ep_destroy_list_add(hba, ep);
@@ -1835,10 +1833,9 @@ static struct iscsi_endpoint *bnx2i_ep_connect(struct Scsi_Host *shost,
 	bnx2i_ep->state = EP_STATE_OFLD_START;
 	bnx2i_ep_ofld_list_add(hba, bnx2i_ep);
 
-	init_timer(&bnx2i_ep->ofld_timer);
+	setup_timer(&bnx2i_ep->ofld_timer, bnx2i_ep_ofld_timer,
+		    (unsigned long)bnx2i_ep);
 	bnx2i_ep->ofld_timer.expires = 2 * HZ + jiffies;
-	bnx2i_ep->ofld_timer.function = bnx2i_ep_ofld_timer;
-	bnx2i_ep->ofld_timer.data = (unsigned long) bnx2i_ep;
 	add_timer(&bnx2i_ep->ofld_timer);
 
 	if (bnx2i_send_conn_ofld_req(hba, bnx2i_ep)) {
@@ -2054,10 +2051,9 @@ int bnx2i_hw_ep_disconnect(struct bnx2i_endpoint *bnx2i_ep)
 		session = conn->session;
 	}
 
-	init_timer(&bnx2i_ep->ofld_timer);
+	setup_timer(&bnx2i_ep->ofld_timer, bnx2i_ep_ofld_timer,
+		    (unsigned long)bnx2i_ep);
 	bnx2i_ep->ofld_timer.expires = hba->conn_teardown_tmo + jiffies;
-	bnx2i_ep->ofld_timer.function = bnx2i_ep_ofld_timer;
-	bnx2i_ep->ofld_timer.data = (unsigned long) bnx2i_ep;
 	add_timer(&bnx2i_ep->ofld_timer);
 
 	if (!test_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic))
Signature · 1 line
2.7.4
author
#5 lore raw

PATCH 5/13 scsi: arcmsr: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/scsi/arcmsr/arcmsr_hba.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/scsi/arcmsr/arcmsr_hba.c +4 -6
index af032c4..a54b6c1 100644
@@ -837,10 +837,9 @@ static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	atomic_set(&acb->rq_map_token, 16);
 	atomic_set(&acb->ante_token_value, 16);
 	acb->fw_flag = FW_NORMAL;
-	init_timer(&acb->eternal_timer);
+	setup_timer(&acb->eternal_timer, &arcmsr_request_device_map,
+		    (unsigned long)acb);
 	acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6 * HZ);
-	acb->eternal_timer.data = (unsigned long) acb;
-	acb->eternal_timer.function = &arcmsr_request_device_map;
 	add_timer(&acb->eternal_timer);
 	if(arcmsr_alloc_sysfs_attr(acb))
 		goto out_free_sysfs;
@@ -930,10 +929,9 @@ static int arcmsr_resume(struct pci_dev *pdev)
 	atomic_set(&acb->rq_map_token, 16);
 	atomic_set(&acb->ante_token_value, 16);
 	acb->fw_flag = FW_NORMAL;
-	init_timer(&acb->eternal_timer);
+	setup_timer(&acb->eternal_timer, &arcmsr_request_device_map,
+		    (unsigned long)acb);
 	acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6 * HZ);
-	acb->eternal_timer.data = (unsigned long) acb;
-	acb->eternal_timer.function = &arcmsr_request_device_map;
 	add_timer(&acb->eternal_timer);
 	return 0;
 controller_stop:
Signature · 1 line
2.7.4
author
#6 lore raw

PATCH 6/13 scsi: be2iscsi: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/scsi/be2iscsi/be_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/scsi/be2iscsi/be_main.c +2 -3
index b4542e7..5579454 100644
@@ -5708,9 +5708,8 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
 	 * Start UE detection here. UE before this will cause stall in probe
 	 * and eventually fail the probe.
 	 */
-	init_timer(&phba->hw_check);
-	phba->hw_check.function = beiscsi_hw_health_check;
-	phba->hw_check.data = (unsigned long)phba;
+	setup_timer(&phba->hw_check, beiscsi_hw_health_check,
+		    (unsigned long)phba);
 	mod_timer(&phba->hw_check,
 		  jiffies + msecs_to_jiffies(BEISCSI_UE_DETECT_INTERVAL));
 	beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT,
Signature · 1 line
2.7.4
author
#7 lore raw

PATCH 7/13 scsi: qla4xxx: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/scsi/qla4xxx/ql4_os.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/scsi/qla4xxx/ql4_os.c +2 -3
index 64c6fa5..32b3e0e 100644
@@ -3961,10 +3961,9 @@ static void qla4xxx_start_timer(struct scsi_qla_host *ha, void *func,
 {
 	DEBUG(printk("scsi: %s: Starting timer thread for adapter %d\n",
 		     __func__, ha->host->host_no));
-	init_timer(&ha->timer);
+	setup_timer(&ha->timer, (void(*)(unsigned long))func,
+		    (unsigned long)ha);
 	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;
 }
Signature · 1 line
2.7.4
author
#8 lore raw

PATCH 8/13 scsi: ncr53c8xx: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/scsi/ncr53c8xx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/ncr53c8xx.c +1 -3
index 5b93ed8..017216f 100644
@@ -8357,9 +8357,7 @@ struct Scsi_Host * __init ncr_attach(struct scsi_host_template *tpnt,
 	if (!np->scripth0)
 		goto attach_error;
 
-	init_timer(&np->timer);
-	np->timer.data     = (unsigned long) np;
-	np->timer.function = ncr53c8xx_timeout;
+	setup_timer(&np->timer, ncr53c8xx_timeout, (unsigned long)np);
 
 	/* Try to map the controller chip to virtual and physical memory. */
 
Signature · 1 line
2.7.4
author
#9 lore raw

PATCH 9/13 scsi: arm: fas216: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/scsi/arm/fas216.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/arm/fas216.c +1 -3
index 2438879..7304d5a 100644
@@ -2849,9 +2849,7 @@ int fas216_init(struct Scsi_Host *host)
 	info->rst_dev_status = -1;
 	info->rst_bus_status = -1;
 	init_waitqueue_head(&info->eh_wait);
-	init_timer(&info->eh_timer);
-	info->eh_timer.data  = (unsigned long)info;
-	info->eh_timer.function = fas216_eh_timer;
+	setup_timer(&info->eh_timer, fas216_eh_timer, (unsigned long)info);
 	
 	spin_lock_init(&info->host_lock);
 
Signature · 1 line
2.7.4
author
#10 lore raw

PATCH 10/13 scsi: libiscsi: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/scsi/libiscsi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/scsi/libiscsi.c +2 -3
index bd4605a..f485280 100644
@@ -2913,9 +2913,8 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, int dd_size,
 	conn->exp_statsn = 0;
 	conn->tmf_state = TMF_INITIAL;
 
-	init_timer(&conn->transport_timer);
-	conn->transport_timer.data = (unsigned long)conn;
-	conn->transport_timer.function = iscsi_check_transport_timeouts;
+	setup_timer(&conn->transport_timer, iscsi_check_transport_timeouts,
+		    (unsigned long)conn);
 
 	INIT_LIST_HEAD(&conn->mgmtqueue);
 	INIT_LIST_HEAD(&conn->cmdqueue);
Signature · 1 line
2.7.4
author
#11 lore raw

PATCH 11/13 scsi: dc395x: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/scsi/dc395x.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/dc395x.c +1 -3
index 5ee7f44..f9aaa8b 100644
@@ -857,9 +857,7 @@ static void waiting_set_timer(struct AdapterCtlBlk *acb, unsigned long to)
 {
 	if (timer_pending(&acb->waiting_timer))
 		return;
-	init_timer(&acb->waiting_timer);
-	acb->waiting_timer.function = waiting_timeout;
-	acb->waiting_timer.data = (unsigned long) acb;
+	setup_timer(&acb->waiting_timer, waiting_timeout, (unsigned long)acb);
 	if (time_before(jiffies + to, acb->last_reset - HZ / 2))
 		acb->waiting_timer.expires =
 		    acb->last_reset - HZ / 2 + 1;
Signature · 1 line
2.7.4
author
#12 lore raw

PATCH 12/13 scsi: qla2xxx: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/scsi/qla2xxx/qla_os.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +2 -3
index 5b2437a..8058eeb 100644
@@ -332,10 +332,9 @@ struct scsi_transport_template *qla2xxx_transport_vport_template = NULL;
 __inline__ void
 qla2x00_start_timer(scsi_qla_host_t *vha, void *func, unsigned long interval)
 {
-	init_timer(&vha->timer);
+	setup_timer(&vha->timer, (void(*)(unsigned long))func,
+		    (unsigned long)vha);
 	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;
 }
Signature · 1 line
2.7.4
author
#13 lore raw

PATCH 13/13 scsi: bfa: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/scsi/bfa/bfad.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/bfa/bfad.c +1 -3
index 5caf5f3..d10826a 100644
@@ -719,9 +719,7 @@ bfad_bfa_tmo(unsigned long data)
 void
 bfad_init_timer(struct bfad_s *bfad)
 {
-	init_timer(&bfad->hal_tmo);
-	bfad->hal_tmo.function = bfad_bfa_tmo;
-	bfad->hal_tmo.data = (unsigned long)bfad;
+	setup_timer(&bfad->hal_tmo, bfad_bfa_tmo, (unsigned long)bfad);
 
 	mod_timer(&bfad->hal_tmo,
 		  jiffies + msecs_to_jiffies(BFA_TIMER_FREQ));
Signature · 1 line
2.7.4
maintainer Acked-by on the v1 series
#14 lore raw
In reply to Allen Pais
Quoted 18 lines · Allen Pais

This series uses setup_timer() helper function. The series addresses the files under drivers/scsi/*.

Allen Pais (13):
scsi: sym53c8xx: use setup_timer() helper.
scsi: qla2xxx: use setup_timer() helper.
scsi: esas2r: use setup_timer() helper.
scsi: bnx2i: use setup_timer() helper.
scsi: arcmsr: use setup_timer() helper.
scsi: be2iscsi: use setup_timer() helper.
scsi: qla4xxx: use setup_timer() helper.
scsi: ncr53c8xx: use setup_timer() helper.
scsi: arm: fas216: use setup_timer() helper.
scsi: libiscsi: use setup_timer() helper.
scsi: dc395x: use setup_timer() helper.
scsi: qla2xxx: use setup_timer() helper.
scsi: bfa: use setup_timer() helper.

Quoted 15 lines
 drivers/scsi/arcmsr/arcmsr_hba.c    | 10 ++++------
 drivers/scsi/arm/fas216.c           |  4 +---
 drivers/scsi/be2iscsi/be_main.c     |  5 ++---
 drivers/scsi/bfa/bfad.c             |  4 +---
 drivers/scsi/bnx2i/bnx2i_iscsi.c    | 14 +++++---------
 drivers/scsi/dc395x.c               |  4 +---
 drivers/scsi/esas2r/esas2r_main.c   |  4 +---
 drivers/scsi/libiscsi.c             |  5 ++---
 drivers/scsi/ncr53c8xx.c            |  4 +---
 drivers/scsi/qla2xxx/qla_inline.h   |  5 ++---
 drivers/scsi/qla2xxx/qla_os.c       |  5 ++---
 drivers/scsi/qla4xxx/ql4_os.c       |  5 ++---
 drivers/scsi/sym53c8xx_2/sym_glue.c |  4 +---
 13 files changed, 25 insertions(+), 48 deletions(-)

Please add for the whole series:

Signature · 2 lines
Lee Duncan
SUSE Labs