Skip to contentSkip to conversation

use setup_timer() helper function.

PATCH In review Allen Pais 3 participants 13 messages Sep 22, 2017 – Sep 29, 2017 3 messages not in the archive InfiniBand

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/infiniband/hw/*.

Allen Pais (8):
infiniband: qib: use setup_timer() helper.
infiniband: nes: use setup_timer() helper.
infiniband: qib: use setup_timer() helper.
infiniband: mthca: use setup_timer() helper.
infiniband: nes: use setup_timer() helper.
infiniband: qib: use setup_timer() helper.
infiniband: nes: use setup_timer() helper.
infiniband: qib: use setup_timer() helper.

 drivers/infiniband/hw/mthca/mthca_catas.c | 4 +---
 drivers/infiniband/hw/nes/nes_cm.c        | 3 +--
 drivers/infiniband/hw/nes/nes_hw.c        | 9 +++------
 drivers/infiniband/hw/nes/nes_nic.c       | 3 +--
 drivers/infiniband/hw/qib/qib_driver.c    | 5 ++---
 drivers/infiniband/hw/qib/qib_iba7220.c   | 5 ++---
 drivers/infiniband/hw/qib/qib_mad.c       | 7 +++----
 drivers/infiniband/hw/qib/qib_sd7220.c    | 5 ++---
 8 files changed, 15 insertions(+), 26 deletions(-)
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1506076036-16496-1-git-send-email-allen.lkml-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

author
#2 lore raw

PATCH 1/8 infiniband: qib: use setup_timer() helper.

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

---
 drivers/infiniband/hw/qib/qib_sd7220.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/infiniband/hw/qib/qib_sd7220.c +2 -3
index c72775f..525b516 100644
@@ -1440,9 +1440,8 @@ void set_7220_relock_poll(struct qib_devdata *dd, int ibup)
 		/* If timer has not yet been started, do so. */
 		if (!cs->relock_timer_active) {
 			cs->relock_timer_active = 1;
-			init_timer(&cs->relock_timer);
-			cs->relock_timer.function = qib_run_relock;
-			cs->relock_timer.data = (unsigned long) dd;
+			setup_timer(&cs->relock_timer, qib_run_relock,
+				    (unsigned long)dd);
 			cs->relock_interval = timeout;
 			cs->relock_timer.expires = jiffies + timeout;
 			add_timer(&cs->relock_timer);
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#3 lore raw

PATCH 2/8 infiniband: nes: use setup_timer() helper.

In reply to a message not in the archive

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

---
 drivers/infiniband/hw/nes/nes_nic.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/infiniband/hw/nes/nes_nic.c +1 -2
index 5921ea3..e4fb0ad 100644
@@ -1746,8 +1746,7 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
 		nesvnic->rdma_enabled = 0;
 	}
 	nesvnic->nic_cq.cq_number = nesvnic->nic.qp_id;
-	init_timer(&nesvnic->event_timer);
-	nesvnic->event_timer.function = NULL;
+	setup_timer(&nesvnic->event_timer, NULL, 0UL);
 	spin_lock_init(&nesvnic->tx_lock);
 	spin_lock_init(&nesvnic->port_ibevent_lock);
 	nesdev->netdev[nesdev->netdev_count] = netdev;
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#4 lore raw

PATCH 3/8 infiniband: qib: use setup_timer() helper.

In reply to a message not in the archive

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

---
 drivers/infiniband/hw/qib/qib_iba7220.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/infiniband/hw/qib/qib_iba7220.c +2 -3
index 04bdd3d..51a9266 100644
@@ -4095,9 +4095,8 @@ static int qib_init_7220_variables(struct qib_devdata *dd)
 	dd->rhdrhead_intr_off = 1ULL << 32;
 
 	/* setup the stats timer; the add_timer is done at end of init */
-	init_timer(&dd->stats_timer);
-	dd->stats_timer.function = qib_get_7220_faststats;
-	dd->stats_timer.data = (unsigned long) dd;
+	setup_timer(&dd->stats_timer, qib_get_7220_faststats,
+		    (unsigned long)dd);
 	dd->stats_timer.expires = jiffies + ACTIVITY_TIMER * HZ;
 
 	/*
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#5 lore raw

PATCH 4/8 infiniband: mthca: use setup_timer() helper.

In reply to a message not in the archive

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

---
 drivers/infiniband/hw/mthca/mthca_catas.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/infiniband/hw/mthca/mthca_catas.c +1 -3
index f6474c2..23cc08d 100644
@@ -149,7 +149,7 @@ void mthca_start_catas_poll(struct mthca_dev *dev)
 {
 	phys_addr_t addr;
 
-	init_timer(&dev->catas_err.timer);
+	setup_timer(&dev->catas_err.timer, poll_catas, (unsigned long)dev);
 	dev->catas_err.map  = NULL;
 
 	addr = pci_resource_start(dev->pdev, 0) +
@@ -164,8 +164,6 @@ void mthca_start_catas_poll(struct mthca_dev *dev)
 		return;
 	}
 
-	dev->catas_err.timer.data     = (unsigned long) dev;
-	dev->catas_err.timer.function = poll_catas;
 	dev->catas_err.timer.expires  = jiffies + MTHCA_CATAS_POLL_INTERVAL;
 	INIT_LIST_HEAD(&dev->catas_err.list);
 	add_timer(&dev->catas_err.timer);
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#6 lore raw

PATCH 5/8 infiniband: nes: use setup_timer() helper.

In reply to a message not in the archive

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

---
 drivers/infiniband/hw/nes/nes_hw.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/infiniband/hw/nes/nes_hw.c +3 -6
index b0adf65..248505f 100644
@@ -598,19 +598,16 @@ struct nes_adapter *nes_init_adapter(struct nes_device *nesdev, u8 hw_rev) {
 	}
 
 	if (nesadapter->hw_rev == NE020_REV) {
-		init_timer(&nesadapter->mh_timer);
-		nesadapter->mh_timer.function = nes_mh_fix;
+		setup_timer(&nesadapter->mh_timer, nes_mh_fix,
+			    (unsigned long)nesdev);
 		nesadapter->mh_timer.expires = jiffies + (HZ/5);  /* 1 second */
-		nesadapter->mh_timer.data = (unsigned long)nesdev;
 		add_timer(&nesadapter->mh_timer);
 	} else {
 		nes_write32(nesdev->regs+NES_INTF_INT_STAT, 0x0f000000);
 	}
 
-	init_timer(&nesadapter->lc_timer);
-	nesadapter->lc_timer.function = nes_clc;
+	setup_timer(&nesadapter->lc_timer, nes_clc, (unsigned long)nesdev);
 	nesadapter->lc_timer.expires = jiffies + 3600 * HZ;  /* 1 hour */
-	nesadapter->lc_timer.data = (unsigned long)nesdev;
 	add_timer(&nesadapter->lc_timer);
 
 	list_add_tail(&nesadapter->list, &nes_adapter_list);
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#7 lore raw

PATCH 6/8 infiniband: qib: use setup_timer() helper.

In reply to a message not in the archive

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

---
 drivers/infiniband/hw/qib/qib_driver.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/infiniband/hw/qib/qib_driver.c +2 -3
index 719906a..6dfcc4f 100644
@@ -735,9 +735,8 @@ void qib_set_led_override(struct qib_pportdata *ppd, unsigned int val)
 	 */
 	if (atomic_inc_return(&ppd->led_override_timer_active) == 1) {
 		/* Need to start timer */
-		init_timer(&ppd->led_override_timer);
-		ppd->led_override_timer.function = qib_run_led_override;
-		ppd->led_override_timer.data = (unsigned long) ppd;
+		setup_timer(&ppd->led_override_timer, qib_run_led_override,
+			    (unsigned long)ppd);
 		ppd->led_override_timer.expires = jiffies + 1;
 		add_timer(&ppd->led_override_timer);
 	} else {
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#8 lore raw

PATCH 7/8 infiniband: nes: use setup_timer() helper.

In reply to a message not in the archive

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

---
 drivers/infiniband/hw/nes/nes_cm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/infiniband/hw/nes/nes_cm.c +1 -2
index de4025d..b1de123 100644
@@ -2670,8 +2670,7 @@ static struct nes_cm_core *nes_cm_alloc_core(void)
 		return NULL;
 
 	INIT_LIST_HEAD(&cm_core->connected_nodes);
-	init_timer(&cm_core->tcp_timer);
-	cm_core->tcp_timer.function = nes_cm_timer_tick;
+	setup_timer(&cm_core->tcp_timer, nes_cm_timer_tick, 0UL);
 
 	cm_core->mtu = NES_CM_DEFAULT_MTU;
 	cm_core->state = NES_CM_STATE_INITED;
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#9 lore raw

PATCH 8/8 infiniband: qib: use setup_timer() helper.

In reply to a message not in the archive

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

---
 drivers/infiniband/hw/qib/qib_mad.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/infiniband/hw/qib/qib_mad.c +3 -4
index 82d9da9..f3d4511 100644
@@ -2478,10 +2478,9 @@ void qib_notify_create_mad_agent(struct rvt_dev_info *rdi, int port_idx)
 
 	/* Initialize xmit_wait structure */
 	dd->pport[port_idx].cong_stats.counter = 0;
-	init_timer(&dd->pport[port_idx].cong_stats.timer);
-	dd->pport[port_idx].cong_stats.timer.function = xmit_wait_timer_func;
-	dd->pport[port_idx].cong_stats.timer.data =
-		(unsigned long)(&dd->pport[port_idx]);
+	setup_timer(&dd->pport[port_idx].cong_stats.timer,
+		    xmit_wait_timer_func,
+		    (unsigned long)(&dd->pport[port_idx]));
 	dd->pport[port_idx].cong_stats.timer.expires = 0;
 	add_timer(&dd->pport[port_idx].cong_stats.timer);
 }
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#10 lore raw
In reply to a message not in the archive
Quoted 2 lines · Allen Pais

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

Since every one of these cases uses 0 or a pointer, I wonder if it would make more sense to have a setup_timer_ptr() variant instead of sprinkling pointer casts everywhere?

Maybe someday we could even have a timer callback signature that has a void * instead of long ?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw
In reply to a message not in the archive
Quoted 14 lines · Allen Pais

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

Allen Pais (8):
infiniband: qib: use setup_timer() helper.
infiniband: nes: use setup_timer() helper.
infiniband: qib: use setup_timer() helper.
infiniband: mthca: use setup_timer() helper.
infiniband: nes: use setup_timer() helper.
infiniband: qib: use setup_timer() helper.
infiniband: nes: use setup_timer() helper.
infiniband: qib: use setup_timer() helper.

Quoted 9 lines
 drivers/infiniband/hw/mthca/mthca_catas.c | 4 +---
 drivers/infiniband/hw/nes/nes_cm.c        | 3 +--
 drivers/infiniband/hw/nes/nes_hw.c        | 9 +++------
 drivers/infiniband/hw/nes/nes_nic.c       | 3 +--
 drivers/infiniband/hw/qib/qib_driver.c    | 5 ++---
 drivers/infiniband/hw/qib/qib_iba7220.c   | 5 ++---
 drivers/infiniband/hw/qib/qib_mad.c       | 7 +++----
 drivers/infiniband/hw/qib/qib_sd7220.c    | 5 ++---
 8 files changed, 15 insertions(+), 26 deletions(-)

This patch series is rejected. If you are doing a "thing", such as update a driver to use setup_timer(), then you do one patch for an entire driver, and on trivial items such as this, even better would be just one patch for all of the drivers under infiniband/hw. But you do *not* do one patch per timer.

Signature · 8 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1506519781.82712.21.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

author
#13 lore raw
Quoted 7 lines

This patch series is rejected. If you are doing a "thing", such as update a driver to use setup_timer(), then you do one patch for an entire driver, and on trivial items such as this, even better would be just one patch for all of the drivers under infiniband/hw. But you do *not* do one patch per timer.

I'll get that done and send out v2.

- Allen
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAOMdWSKD-h4y-ggh7m-_kNV+0PMJC+Nf7Bj02CF7Q6rjMtRniw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#15 lore raw
Quoted 11 lines · Allen
Quoted 9 lines

This patch series is rejected. If you are doing a "thing", such as update a driver to use setup_timer(), then you do one patch for an entire driver, and on trivial items such as this, even better would be
just one patch for all of the drivers under infiniband/hw. But you do
*not* do one patch per timer.

I'll get that done and send out v2.

Keep in mind that I just took a patch to the timer code in the qib driver, so you might need to wait until I've pushed my tree out today and then rebase your work on it and drop out anything that's already been done.

Signature · 8 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html