From: Allen Pais <allen.lkml@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, sameo@linux.intel.com,
Allen Pais <allen.lkml@gmail.com>
Subject: [PATCH v2 4/4] net: nfc: llcp_core: use setup_timer() helper.
Date: Mon, 25 Sep 2017 13:00:05 +0530 [thread overview]
Message-ID: <1506324605-10160-4-git-send-email-allen.lkml@gmail.com> (raw)
In-Reply-To: <1506324605-10160-1-git-send-email-allen.lkml@gmail.com>
Use setup_timer function instead of initializing timer with the
function and data fields.
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
v2: rebased to latest net-next.
net/nfc/llcp_core.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/net/nfc/llcp_core.c b/net/nfc/llcp_core.c
index 02eef5c..7988185 100644
--- a/net/nfc/llcp_core.c
+++ b/net/nfc/llcp_core.c
@@ -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);
--
2.7.4
next prev parent reply other threads:[~2017-09-25 7:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-25 7:30 [PATCH v2 1/4] net: af_packet: use setup_timer() helper Allen Pais
2017-09-25 7:30 ` [PATCH v2 2/4] net: nfc: hci: " Allen Pais
2017-09-25 20:19 ` David Miller
2017-09-25 7:30 ` [PATCH v2 3/4] net: nfc: hci: llc_shdlc: " Allen Pais
2017-09-25 20:19 ` David Miller
2017-09-25 7:30 ` Allen Pais [this message]
2017-09-25 20:19 ` [PATCH v2 4/4] net: nfc: llcp_core: " David Miller
2017-09-25 20:19 ` [PATCH v2 1/4] net: af_packet: " David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1506324605-10160-4-git-send-email-allen.lkml@gmail.com \
--to=allen.lkml@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).