IB/rxe: use setup_timer to simplify the code
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 7 Feb 2017 15:15:10 +0000 (15:15 +0000)
committerDoug Ledford <dledford@redhat.com>
Sun, 19 Feb 2017 14:18:31 +0000 (09:18 -0500)
Use setup_timer function instead of initializing timer with the function
and data fields.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rxe/rxe_qp.c

index 5749ff0ea9ba6e86f903aed70d0f0687bec8fcf0..f98a19e61a3db5215f706077f4eff7b91f114400 100644 (file)
@@ -273,13 +273,8 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
        rxe_init_task(rxe, &qp->comp.task, qp,
                      rxe_completer, "comp");
 
-       init_timer(&qp->rnr_nak_timer);
-       qp->rnr_nak_timer.function = rnr_nak_timer;
-       qp->rnr_nak_timer.data = (unsigned long)qp;
-
-       init_timer(&qp->retrans_timer);
-       qp->retrans_timer.function = retransmit_timer;
-       qp->retrans_timer.data = (unsigned long)qp;
+       setup_timer(&qp->rnr_nak_timer, rnr_nak_timer, (unsigned long)qp);
+       setup_timer(&qp->retrans_timer, retransmit_timer, (unsigned long)qp);
        qp->qp_timeout_jiffies = 0; /* Can't be set for UD/UC in modify_qp */
 
        return 0;