IB/nes: use setup_timer
authorGeliang Tang <geliangtang@gmail.com>
Sat, 22 Apr 2017 01:32:55 +0000 (09:32 +0800)
committerDoug Ledford <dledford@redhat.com>
Fri, 28 Apr 2017 17:19:13 +0000 (13:19 -0400)
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/nes/nes_hw.c
drivers/infiniband/hw/nes/nes_mgt.c
drivers/infiniband/hw/nes/nes_verbs.c

index 4bbff7a33d188ef977ae2782b8f7a8b4b0739291..8f9d8b4ad583918dc4a2785b1df33d6eee3b6921 100644 (file)
@@ -1849,9 +1849,8 @@ int nes_init_nic_qp(struct nes_device *nesdev, struct net_device *netdev)
                wqe_count -= counter;
                nes_write32(nesdev->regs+NES_WQE_ALLOC, (counter << 24) | nesvnic->nic.qp_id);
        } while (wqe_count);
-       init_timer(&nesvnic->rq_wqes_timer);
-       nesvnic->rq_wqes_timer.function = nes_rq_wqes_timeout;
-       nesvnic->rq_wqes_timer.data = (unsigned long)nesvnic;
+       setup_timer(&nesvnic->rq_wqes_timer, nes_rq_wqes_timeout,
+                   (unsigned long)nesvnic);
        nes_debug(NES_DBG_INIT, "NAPI support Enabled\n");
        if (nesdev->nesadapter->et_use_adaptive_rx_coalesce)
        {
index 33624f17c347995616750f3e10c426d4b3e22ccf..77226cf4ea02a3d8fd9e06a175b578277ff46c9d 100644 (file)
@@ -1040,9 +1040,8 @@ int nes_init_mgt_qp(struct nes_device *nesdev, struct net_device *netdev, struct
                        mgtvnic->mgt.rx_skb[counter] = skb;
                }
 
-               init_timer(&mgtvnic->rq_wqes_timer);
-               mgtvnic->rq_wqes_timer.function = nes_mgt_rq_wqes_timeout;
-               mgtvnic->rq_wqes_timer.data = (unsigned long)mgtvnic;
+               setup_timer(&mgtvnic->rq_wqes_timer, nes_mgt_rq_wqes_timeout,
+                           (unsigned long)mgtvnic);
 
                wqe_count = NES_MGT_WQ_COUNT - 1;
                mgtvnic->mgt.rq_head = wqe_count;
index 11f7c308c7ad4f285d112edc12a6615877c3274d..c5eb78f4ca8bf091ba3cd93afa0df9b2e9fef92d 100644 (file)
@@ -1308,9 +1308,8 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
        init_completion(&nesqp->rq_drained);
 
        nesqp->sig_all = (init_attr->sq_sig_type == IB_SIGNAL_ALL_WR);
-       init_timer(&nesqp->terminate_timer);
-       nesqp->terminate_timer.function = nes_terminate_timeout;
-       nesqp->terminate_timer.data = (unsigned long)nesqp;
+       setup_timer(&nesqp->terminate_timer, nes_terminate_timeout,
+                   (unsigned long)nesqp);
 
        /* update the QP table */
        nesdev->nesadapter->qp_table[nesqp->hwqp.qp_id-NES_FIRST_QPN] = nesqp;