Skip to contentSkip to conversation

mISDN: hfcpci: Convert timers to use timer_setup()

PATCH Applied Kees Cook 2 participants 2 messages Nov 2, 2017 – Nov 3, 2017

Subsystems (2)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 mISDN: hfcpci: 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 Karsten Keil <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Arvind Yadav <[email protected]>
Cc Geliang Tang <[email protected]>
---
 drivers/isdn/hardware/mISDN/hfcpci.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/isdn/hardware/mISDN/hfcpci.c +4 -6
index d2e401a8090e..e4ebbee863a1 100644
@@ -2265,7 +2265,7 @@ static struct pci_driver hfc_driver = {
 };
 
 static int
-_hfcpci_softirq(struct device *dev, void *arg)
+_hfcpci_softirq(struct device *dev, void *unused)
 {
 	struct hfc_pci  *hc = dev_get_drvdata(dev);
 	struct bchannel *bch;
@@ -2290,9 +2290,9 @@ _hfcpci_softirq(struct device *dev, void *arg)
 }
 
 static void
-hfcpci_softirq(void *arg)
+hfcpci_softirq(struct timer_list *unused)
 {
-	WARN_ON_ONCE(driver_for_each_device(&hfc_driver.driver, NULL, arg,
+	WARN_ON_ONCE(driver_for_each_device(&hfc_driver.driver, NULL, NULL,
 				      _hfcpci_softirq) != 0);
 
 	/* if next event would be in the past ... */
@@ -2327,9 +2327,7 @@ HFC_init(void)
 	if (poll != HFCPCI_BTRANS_THRESHOLD) {
 		printk(KERN_INFO "%s: Using alternative poll value of %d\n",
 		       __func__, poll);
-		hfc_tl.function = (void *)hfcpci_softirq;
-		hfc_tl.data = 0;
-		init_timer(&hfc_tl);
+		timer_setup(&hfc_tl, hfcpci_softirq, 0);
 		hfc_tl.expires = jiffies + tics;
 		hfc_jiffies = hfc_tl.expires;
 		add_timer(&hfc_tl);
Signature · 6 lines
2.7.4


-- 
Kees Cook
Pixel Security
maintainer Applied
#1 lore raw

From: Kees Cook <[email protected]>
Date: Thu, 2 Nov 2017 16:18:07 -0700

Quoted 10 lines

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 Karsten Keil <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Arvind Yadav <[email protected]>
Cc Geliang Tang <[email protected]>

Applied.