Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

atm: idt77105: Use setup_timer

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>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Vaishali Thakkar and committed by
David S. Miller
bae23b68 f21fb3ed

+2 -4
+2 -4
drivers/atm/idt77105.c
··· 306 306 if (start_timer) { 307 307 start_timer = 0; 308 308 309 - init_timer(&stats_timer); 309 + setup_timer(&stats_timer, idt77105_stats_timer_func, 0UL); 310 310 stats_timer.expires = jiffies+IDT77105_STATS_TIMER_PERIOD; 311 - stats_timer.function = idt77105_stats_timer_func; 312 311 add_timer(&stats_timer); 313 312 314 - init_timer(&restart_timer); 313 + setup_timer(&restart_timer, idt77105_restart_timer_func, 0UL); 315 314 restart_timer.expires = jiffies+IDT77105_RESTART_TIMER_PERIOD; 316 - restart_timer.function = idt77105_restart_timer_func; 317 315 add_timer(&restart_timer); 318 316 } 319 317 spin_unlock_irqrestore(&idt77105_priv_lock, flags);