public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] atm: idt77105: Use setup_timer
@ 2015-06-10  5:40 Vaishali Thakkar
  2015-06-11  5:46 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Vaishali Thakkar @ 2015-06-10  5:40 UTC (permalink / raw)
  To: Chas Williams; +Cc: linux-atm-general, netdev, linux-kernel, julia.lawall

Use the timer API function setup_timer instead of structure field
assignments to initialize a timer.

A simplified version of the Coccinelle semantic patch that performs
this transformation is as follows:

@change@
expression e1, e2, a;
@@

-init_timer(&e1);
+setup_timer(&e1, a, 0UL);
... when != a = e2
-e1.function = a;

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
---
 drivers/atm/idt77105.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c
index 909c95b..feb023d 100644
--- a/drivers/atm/idt77105.c
+++ b/drivers/atm/idt77105.c
@@ -306,14 +306,12 @@ static int idt77105_start(struct atm_dev *dev)
 	if (start_timer) {
 		start_timer = 0;
                 
-		init_timer(&stats_timer);
+		setup_timer(&stats_timer, idt77105_stats_timer_func, 0UL);
 		stats_timer.expires = jiffies+IDT77105_STATS_TIMER_PERIOD;
-		stats_timer.function = idt77105_stats_timer_func;
 		add_timer(&stats_timer);
                 
-		init_timer(&restart_timer);
+		setup_timer(&restart_timer, idt77105_restart_timer_func, 0UL);
 		restart_timer.expires = jiffies+IDT77105_RESTART_TIMER_PERIOD;
-		restart_timer.function = idt77105_restart_timer_func;
 		add_timer(&restart_timer);
 	}
 	spin_unlock_irqrestore(&idt77105_priv_lock, flags);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] atm: idt77105: Use setup_timer
  2015-06-10  5:40 [PATCH] atm: idt77105: Use setup_timer Vaishali Thakkar
@ 2015-06-11  5:46 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-06-11  5:46 UTC (permalink / raw)
  To: vthakkar1994
  Cc: 3chas3, linux-atm-general, netdev, linux-kernel, julia.lawall

From: Vaishali Thakkar <vthakkar1994@gmail.com>
Date: Wed, 10 Jun 2015 11:10:05 +0530

> Use the timer API function setup_timer instead of structure field
> assignments to initialize a timer.
> 
> A simplified version of the Coccinelle semantic patch that performs
> this transformation is as follows:
> 
> @change@
> expression e1, e2, a;
> @@
> 
> -init_timer(&e1);
> +setup_timer(&e1, a, 0UL);
> ... when != a = e2
> -e1.function = a;
> 
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>

Applied to net-next, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-11  5:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-10  5:40 [PATCH] atm: idt77105: Use setup_timer Vaishali Thakkar
2015-06-11  5:46 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox