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

staging: rdma: hfi1: chip: Use setup_timer

Use the timer API function setup_timer instead of init_timer, removing
the structure field assignments.

<smpl>

@timer@
expression e1,e2,e3,fn_ptr;
@@
-init_timer(&e1);
+setup_timer(&e1, fn_ptr, e2);
... when != fn_ptr = e3
-e1.function = fn_ptr;
-e1.data = e2;

</smpl>

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Muhammad Falak R Wani and committed by
Greg Kroah-Hartman
24523a94 6f663d5d

+3 -6
+3 -6
drivers/staging/rdma/hfi1/chip.c
··· 2215 2215 2216 2216 static int init_rcverr(struct hfi1_devdata *dd) 2217 2217 { 2218 - init_timer(&dd->rcverr_timer); 2219 - dd->rcverr_timer.function = update_rcverr_timer; 2220 - dd->rcverr_timer.data = (unsigned long) dd; 2218 + setup_timer(&dd->rcverr_timer, update_rcverr_timer, (unsigned long)dd); 2221 2219 /* Assume the hardware counter has been reset */ 2222 2220 dd->rcv_ovfl_cnt = 0; 2223 2221 return mod_timer(&dd->rcverr_timer, jiffies + HZ * RCVERR_CHECK_TIME); ··· 8154 8156 struct hfi1_pportdata *ppd; 8155 8157 8156 8158 /* set up the stats timer; the add_timer is done at the end */ 8157 - init_timer(&dd->synth_stats_timer); 8158 - dd->synth_stats_timer.function = update_synth_timer; 8159 - dd->synth_stats_timer.data = (unsigned long) dd; 8159 + setup_timer(&dd->synth_stats_timer, update_synth_timer, 8160 + (unsigned long)dd); 8160 8161 8161 8162 /***********************/ 8162 8163 /* per device counters */