IB/rxe: Convert timers to use timer_setup()
authorKees Cook <keescook@chromium.org>
Tue, 24 Oct 2017 10:28:27 +0000 (03:28 -0700)
committerDoug Ledford <dledford@redhat.com>
Wed, 25 Oct 2017 19:24:49 +0000 (15:24 -0400)
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Moni Shoua <monis@mellanox.com>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: linux-rdma@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rxe/rxe_comp.c
drivers/infiniband/sw/rxe/rxe_loc.h
drivers/infiniband/sw/rxe/rxe_qp.c
drivers/infiniband/sw/rxe/rxe_req.c

index ff64875e3d1540da062cd55d54036e9e6a511d6c..6cdc40ed8a9f8bbc157b8f86f3ea5e3b90fed0f7 100644 (file)
@@ -136,9 +136,9 @@ static enum ib_wc_opcode wr_to_wc_opcode(enum ib_wr_opcode opcode)
        }
 }
 
-void retransmit_timer(unsigned long data)
+void retransmit_timer(struct timer_list *t)
 {
-       struct rxe_qp *qp = (struct rxe_qp *)data;
+       struct rxe_qp *qp = from_timer(qp, t, retrans_timer);
 
        if (qp->valid) {
                qp->comp.timeout = 1;
index 77b3ed0df93637a236cf33a02e0f303df5f4e09f..d7472a442a2cf108e3a549810fdfcb0f211b7446 100644 (file)
@@ -218,8 +218,8 @@ static inline void rxe_advance_resp_resource(struct rxe_qp *qp)
                qp->resp.res_head = 0;
 }
 
-void retransmit_timer(unsigned long data);
-void rnr_nak_timer(unsigned long data);
+void retransmit_timer(struct timer_list *t);
+void rnr_nak_timer(struct timer_list *t);
 
 /* rxe_srq.c */
 #define IB_SRQ_INIT_MASK (~IB_SRQ_LIMIT)
index 00bda9380a2e4589c23e21b2a96ecaa2f4719ef9..4469592b839d03aed0278051f3ac7cac507cebf5 100644 (file)
@@ -275,8 +275,8 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
 
        qp->qp_timeout_jiffies = 0; /* Can't be set for UD/UC in modify_qp */
        if (init->qp_type == IB_QPT_RC) {
-               setup_timer(&qp->rnr_nak_timer, rnr_nak_timer, (unsigned long)qp);
-               setup_timer(&qp->retrans_timer, retransmit_timer, (unsigned long)qp);
+               timer_setup(&qp->rnr_nak_timer, rnr_nak_timer, 0);
+               timer_setup(&qp->retrans_timer, retransmit_timer, 0);
        }
        return 0;
 }
index d84222f9d5d2ed11356c4a3399e311a7c5364e5f..26a7f923045b51e3aacb89edbaf5996707230c87 100644 (file)
@@ -118,9 +118,9 @@ static void req_retry(struct rxe_qp *qp)
        }
 }
 
-void rnr_nak_timer(unsigned long data)
+void rnr_nak_timer(struct timer_list *t)
 {
-       struct rxe_qp *qp = (struct rxe_qp *)data;
+       struct rxe_qp *qp = from_timer(qp, t, rnr_nak_timer);
 
        pr_debug("qp#%d rnr nak timer fired\n", qp_num(qp));
        rxe_run_task(&qp->req.task, 1);