Skip to contentSkip to conversation

staging: rdma: hfi1: Use setup_timer

PATCH In review Muhammad Falak R Wani 2 participants 2 messages Oct 24, 2015 – Oct 25, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 staging: rdma: hfi1: 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>

---
 drivers/staging/rdma/hfi1/chip.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/staging/rdma/hfi1/chip.c +3 -6
index 46ebc38..c403957 100644
@@ -2215,9 +2215,7 @@ static void update_rcverr_timer(unsigned long opaque)
 
 static int init_rcverr(struct hfi1_devdata *dd)
 {
-	init_timer(&dd->rcverr_timer);
-	dd->rcverr_timer.function = update_rcverr_timer;
-	dd->rcverr_timer.data = (unsigned long) dd;
+	setup_timer(&dd->rcverr_timer, update_rcverr_timer, (unsigned long)dd);
 	/* Assume the hardware counter has been reset */
 	dd->rcv_ovfl_cnt = 0;
 	return mod_timer(&dd->rcverr_timer, jiffies + HZ * RCVERR_CHECK_TIME);
@@ -8156,9 +8154,8 @@ static int init_cntrs(struct hfi1_devdata *dd)
 	struct hfi1_pportdata *ppd;
 
 	/* set up the stats timer; the add_timer is done at the end */
-	init_timer(&dd->synth_stats_timer);
-	dd->synth_stats_timer.function = update_synth_timer;
-	dd->synth_stats_timer.data = (unsigned long) dd;
+	setup_timer(&dd->synth_stats_timer, update_synth_timer,
+		    (unsigned long)dd);
 
 	/***********************/
 	/* per device counters */
Signature · 1 line
1.9.1
#1 lore raw
Quoted 14 lines · Muhammad Falak R Wani

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

<smpl>

@timer@
expression e1,e2,e3,fn_ptr;
@@

(quoted diff) +1 -1
-init_timer(&e1);
+setup_timer(&e1, fn_ptr, e2);

... when != fn_ptr = e3

(quoted diff) +0 -2
-e1.function = fn_ptr;
-e1.data = e2;
Quoted 6 lines

</smpl>

---
 drivers/staging/rdma/hfi1/chip.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Again, 3 patches, all with the same subject, not good :(