Skip to contentSkip to conversation

net: af_packet: use setup_timer() helper.

PATCH Applied Allen Pais 2 participants 8 messages Sep 25, 2017

Subsystems (4)
lore
Share & tools
lore

Allen Pais

author
#0 lore raw

PATCH v2 1/4 net: af_packet: use setup_timer() helper.

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

---
v2: rebased to latest net-next.

 net/packet/af_packet.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/packet/af_packet.c +1 -3
index d288f52..b0f2218 100644
@@ -544,9 +544,7 @@ static void prb_init_blk_timer(struct packet_sock *po,
 		struct tpacket_kbdq_core *pkc,
 		void (*func) (unsigned long))
 {
-	init_timer(&pkc->retire_blk_timer);
-	pkc->retire_blk_timer.data = (long)po;
-	pkc->retire_blk_timer.function = func;
+	setup_timer(&pkc->retire_blk_timer, func, (long)po);
 	pkc->retire_blk_timer.expires = jiffies;
 }
 
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v2 2/4 net: nfc: hci: use setup_timer() helper.

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

---
v2: rebased to latest net-next.

 net/nfc/hci/core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
net/nfc/hci/core.c +2 -3
index b740fef..a8a6e78 100644
@@ -1004,9 +1004,8 @@ int nfc_hci_register_device(struct nfc_hci_dev *hdev)
 
 	INIT_WORK(&hdev->msg_tx_work, nfc_hci_msg_tx_work);
 
-	init_timer(&hdev->cmd_timer);
-	hdev->cmd_timer.data = (unsigned long)hdev;
-	hdev->cmd_timer.function = nfc_hci_cmd_timeout;
+	setup_timer(&hdev->cmd_timer, nfc_hci_cmd_timeout,
+		    (unsigned long)hdev);
 
 	skb_queue_head_init(&hdev->rx_hcp_frags);
 
Signature · 1 line
2.7.4
maintainer Applied
#2 lore raw

Re: [PATCH v2 2/4] net: nfc: hci: use setup_timer() helper.

From: Allen Pais <[email protected]>
Date: Mon, 25 Sep 2017 13:00:03 +0530

Quoted 6 lines

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

---
v2: rebased to latest net-next.

Applied.

author
#3 lore raw

PATCH v2 3/4 net: nfc: hci: llc_shdlc: use setup_timer() helper.

In reply to Allen Pais

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

---
v2: rebased to latest net-next.

 net/nfc/hci/llc_shdlc.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
net/nfc/hci/llc_shdlc.c +6 -9
index 17e59a0..58df37e 100644
@@ -763,17 +763,14 @@ static void *llc_shdlc_init(struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv,
 	mutex_init(&shdlc->state_mutex);
 	shdlc->state = SHDLC_DISCONNECTED;
 
-	init_timer(&shdlc->connect_timer);
-	shdlc->connect_timer.data = (unsigned long)shdlc;
-	shdlc->connect_timer.function = llc_shdlc_connect_timeout;
+	setup_timer(&shdlc->connect_timer, llc_shdlc_connect_timeout,
+		    (unsigned long)shdlc);
 
-	init_timer(&shdlc->t1_timer);
-	shdlc->t1_timer.data = (unsigned long)shdlc;
-	shdlc->t1_timer.function = llc_shdlc_t1_timeout;
+	setup_timer(&shdlc->t1_timer, llc_shdlc_t1_timeout,
+		    (unsigned long)shdlc);
 
-	init_timer(&shdlc->t2_timer);
-	shdlc->t2_timer.data = (unsigned long)shdlc;
-	shdlc->t2_timer.function = llc_shdlc_t2_timeout;
+	setup_timer(&shdlc->t2_timer, llc_shdlc_t2_timeout,
+		    (unsigned long)shdlc);
 
 	shdlc->w = SHDLC_MAX_WINDOW;
 	shdlc->srej_support = SHDLC_SREJ_SUPPORT;
Signature · 1 line
2.7.4
maintainer Applied
#4 lore raw

Re: [PATCH v2 3/4] net: nfc: hci: llc_shdlc: use setup_timer() helper.

From: Allen Pais <[email protected]>
Date: Mon, 25 Sep 2017 13:00:04 +0530

Quoted 6 lines

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

---
v2: rebased to latest net-next.

Applied.

author
#5 lore raw

PATCH v2 4/4 net: nfc: llcp_core: use setup_timer() helper.

In reply to Allen Pais

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

---
v2: rebased to latest net-next.

 net/nfc/llcp_core.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
net/nfc/llcp_core.c +4 -6
index 02eef5c..7988185 100644
@@ -1573,9 +1573,8 @@ int nfc_llcp_register_device(struct nfc_dev *ndev)
 	INIT_LIST_HEAD(&local->list);
 	kref_init(&local->ref);
 	mutex_init(&local->sdp_lock);
-	init_timer(&local->link_timer);
-	local->link_timer.data = (unsigned long) local;
-	local->link_timer.function = nfc_llcp_symm_timer;
+	setup_timer(&local->link_timer, nfc_llcp_symm_timer,
+		    (unsigned long)local);
 
 	skb_queue_head_init(&local->tx_queue);
 	INIT_WORK(&local->tx_work, nfc_llcp_tx_work);
@@ -1601,9 +1600,8 @@ int nfc_llcp_register_device(struct nfc_dev *ndev)
 
 	mutex_init(&local->sdreq_lock);
 	INIT_HLIST_HEAD(&local->pending_sdreqs);
-	init_timer(&local->sdreq_timer);
-	local->sdreq_timer.data = (unsigned long) local;
-	local->sdreq_timer.function = nfc_llcp_sdreq_timer;
+	setup_timer(&local->sdreq_timer, nfc_llcp_sdreq_timer,
+		    (unsigned long)local);
 	INIT_WORK(&local->sdreq_timeout_work, nfc_llcp_sdreq_timeout_work);
 
 	list_add(&local->list, &llcp_devices);
Signature · 1 line
2.7.4
maintainer Applied
#6 lore raw

Re: [PATCH v2 4/4] net: nfc: llcp_core: use setup_timer() helper.

From: Allen Pais <[email protected]>
Date: Mon, 25 Sep 2017 13:00:05 +0530

Quoted 6 lines

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

---
v2: rebased to latest net-next.

Applied.