Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1736631 > unrolled thread

[PATCH 1/1] net: wan : hdlc: use setup_timer() helper

Started byAllen Pais <allen.lkml@gmail.com>
First post2017-09-21 14:50 +0200
Last post2017-09-22 00:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] net: wan : hdlc: use setup_timer() helper Allen Pais <allen.lkml@gmail.com> - 2017-09-21 14:50 +0200
    Re: [PATCH 1/1] net: wan : hdlc: use setup_timer() helper David Miller <davem@davemloft.net> - 2017-09-22 00:50 +0200

#1736631 — [PATCH 1/1] net: wan : hdlc: use setup_timer() helper

FromAllen Pais <allen.lkml@gmail.com>
Date2017-09-21 14:50 +0200
Subject[PATCH 1/1] net: wan : hdlc: use setup_timer() helper
Message-ID<us95w-13h-7@gated-at.bofh.it>
    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/wan/hdlc_fr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index 78596e4..425a47f 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -1003,11 +1003,10 @@ static void fr_start(struct net_device *dev)
 		state(hdlc)->n391cnt = 0;
 		state(hdlc)->txseq = state(hdlc)->rxseq = 0;
 
-		init_timer(&state(hdlc)->timer);
+		setup_timer(&state(hdlc)->timer, fr_timer,
+			    (unsigned long)dev);
 		/* First poll after 1 s */
 		state(hdlc)->timer.expires = jiffies + HZ;
-		state(hdlc)->timer.function = fr_timer;
-		state(hdlc)->timer.data = (unsigned long)dev;
 		add_timer(&state(hdlc)->timer);
 	} else
 		fr_set_link_state(1, dev);
-- 
2.7.4

[toc] | [next] | [standalone]


#1737085

FromDavid Miller <davem@davemloft.net>
Date2017-09-22 00:50 +0200
Message-ID<usis9-6Mo-9@gated-at.bofh.it>
In reply to#1736631
From: Allen Pais <allen.lkml@gmail.com>
Date: Thu, 21 Sep 2017 18:17:55 +0530

>     Use setup_timer function instead of initializing timer with the
>     function and data fields.
> 
> Signed-off-by: Allen Pais <allen.lkml@gmail.com>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web