From: Amitoj Kaur Chawla <amitoj1606@gmail.com>
To: klassert@mathematik.tu-chemnitz.de, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: julia.lawall@lip6.fr
Subject: [PATCH 3/3] 3c59x: Use setup_timer()
Date: Wed, 24 Feb 2016 19:28:19 +0530 [thread overview]
Message-ID: <20160224135819.GA14426@amitoj-Inspiron-3542> (raw)
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.
The Coccinelle semantic patch that fixes this problem is
as follows:
// <smpl>
@@
expression t,f,d;
@@
-init_timer(&t);
+setup_timer(&t,f,d);
...
-t.data = d;
-t.function = f;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/net/ethernet/3com/3c59x.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
index 79e1a02..c377607 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -1601,15 +1601,9 @@ vortex_up(struct net_device *dev)
dev->name, media_tbl[dev->if_port].name);
}
- init_timer(&vp->timer);
+ setup_timer(&vp->timer, vortex_timer, (unsigned long)dev);
vp->timer.expires = RUN_AT(media_tbl[dev->if_port].wait);
- vp->timer.data = (unsigned long)dev;
- vp->timer.function = vortex_timer; /* timer handler */
- add_timer(&vp->timer);
-
- init_timer(&vp->rx_oom_timer);
- vp->rx_oom_timer.data = (unsigned long)dev;
- vp->rx_oom_timer.function = rx_oom_timer;
+ setup_timer(&vp->rx_oom_timer, rx_oom_timer, (unsigned long)dev);
if (vortex_debug > 1)
pr_debug("%s: Initial media type %s.\n",
--
1.9.1
next reply other threads:[~2016-02-24 13:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-24 13:58 Amitoj Kaur Chawla [this message]
2016-02-25 21:52 ` [PATCH 3/3] 3c59x: Use setup_timer() David Miller
2016-02-27 18:48 ` Stafford Horne
2016-02-28 7:05 ` Amitoj Kaur Chawla
2016-02-28 7:49 ` [PATCH] 3c59x: Ensure to apply the expires time Stafford Horne
2016-02-29 4:40 ` David Miller
2016-02-28 7:53 ` [PATCH 3/3] 3c59x: Use setup_timer() Stafford Horne
2016-02-28 8:13 ` Amitoj Kaur Chawla
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=20160224135819.GA14426@amitoj-Inspiron-3542 \
--to=amitoj1606@gmail.com \
--cc=julia.lawall@lip6.fr \
--cc=klassert@mathematik.tu-chemnitz.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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