diff mbox

[-next] IB/rxe: use setup_timer to simplify the code

Message ID 20170207151510.12503-1-weiyj.lk@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Wei Yongjun Feb. 7, 2017, 3:15 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

Use setup_timer function instead of initializing timer with the function
and data fields.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/infiniband/sw/rxe/rxe_qp.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)




--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Leon Romanovsky Feb. 7, 2017, 4:29 p.m. UTC | #1
On Tue, Feb 07, 2017 at 03:15:10PM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> Use setup_timer function instead of initializing timer with the function
> and data fields.
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_qp.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Doug Ledford Feb. 19, 2017, 1:21 p.m. UTC | #2
On Tue, 2017-02-07 at 15:15 +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Use setup_timer function instead of initializing timer with the
> function
> and data fields.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Thanks, applied.
diff mbox

Patch

diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c
index 5749ff0..f98a19e 100644
--- a/drivers/infiniband/sw/rxe/rxe_qp.c
+++ b/drivers/infiniband/sw/rxe/rxe_qp.c
@@ -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;