summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/qib/qib_mad.c
diff options
context:
space:
mode:
authorHimanshu Jha <himanshujha199640@gmail.com>2017-09-24 17:21:07 +0530
committerDoug Ledford <dledford@redhat.com>2017-09-29 11:18:56 -0400
commite1ac263fcb58a63aed0d9a75d22e045f88a53bb2 (patch)
tree4e9c5a7b41a29c287f2c48fcb43630d643a28220 /drivers/infiniband/hw/qib/qib_mad.c
parente538e0aca33f81fbfaa10a6954b40ff4360686dd (diff)
IB/qib: Use setup_timer and mod_timer
Use setup_timer and mod_timer API instead of structure assignments. This is done using Coccinelle and semantic patch used for this as follows: @@ expression x,y,z,a,b; @@ -init_timer (&x); +setup_timer (&x, y, z); +mod_timer (&a, b); -x.function = y; -x.data = z; -x.expires = b; -add_timer(&a); Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/qib/qib_mad.c')
-rw-r--r--drivers/infiniband/hw/qib/qib_mad.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/qib/qib_mad.c b/drivers/infiniband/hw/qib/qib_mad.c
index 82d9da9b6997..1237952c144e 100644
--- a/drivers/infiniband/hw/qib/qib_mad.c
+++ b/drivers/infiniband/hw/qib/qib_mad.c
@@ -2478,12 +2478,10 @@ void qib_notify_create_mad_agent(struct rvt_dev_info *rdi, int port_idx)
/* Initialize xmit_wait structure */
dd->pport[port_idx].cong_stats.counter = 0;
- init_timer(&dd->pport[port_idx].cong_stats.timer);
- dd->pport[port_idx].cong_stats.timer.function = xmit_wait_timer_func;
- dd->pport[port_idx].cong_stats.timer.data =
- (unsigned long)(&dd->pport[port_idx]);
- dd->pport[port_idx].cong_stats.timer.expires = 0;
- add_timer(&dd->pport[port_idx].cong_stats.timer);
+ setup_timer(&dd->pport[port_idx].cong_stats.timer,
+ xmit_wait_timer_func,
+ (unsigned long)(&dd->pport[port_idx]));
+ mod_timer(&dd->pport[port_idx].cong_stats.timer, 0);
}
void qib_notify_free_mad_agent(struct rvt_dev_info *rdi, int port_idx)