Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma
[firefly-linux-kernel-4.4.55.git] / drivers / staging / rdma / ipath / ipath_verbs.c
index 15633ec1843fd1195cc4cdac8c9919c04bc85ce0..1778dee13f99269c51cc90f6c4d09a6f46a13a21 100644 (file)
@@ -399,9 +399,6 @@ static int ipath_post_one_send(struct ipath_qp *qp, struct ib_send_wr *wr)
        if (qp->ibqp.qp_type != IB_QPT_UC &&
            qp->ibqp.qp_type != IB_QPT_RC)
                memcpy(&wqe->ud_wr, ud_wr(wr), sizeof(wqe->ud_wr));
-       else if (wr->opcode == IB_WR_FAST_REG_MR)
-               memcpy(&wqe->fast_reg_wr, fast_reg_wr(wr),
-                       sizeof(wqe->fast_reg_wr));
        else if (wr->opcode == IB_WR_RDMA_WRITE_WITH_IMM ||
                 wr->opcode == IB_WR_RDMA_WRITE ||
                 wr->opcode == IB_WR_RDMA_READ)
@@ -755,9 +752,9 @@ static void ipath_ib_timer(struct ipath_ibdev *dev)
                        dev->ipath_spkts = tc - dev->ipath_spkts;
                        dev->ipath_rpkts = td - dev->ipath_rpkts;
                        dev->ipath_xmit_wait = te - dev->ipath_xmit_wait;
-               }
-               else
+               } else {
                        dev->pma_sample_interval--;
+               }
        }
        spin_unlock_irqrestore(&dev->pending_lock, flags);
 
@@ -1972,9 +1969,8 @@ static int enable_timer(struct ipath_devdata *dd)
                                 dd->ipath_gpio_mask);
        }
 
-       init_timer(&dd->verbs_timer);
-       dd->verbs_timer.function = __verbs_timer;
-       dd->verbs_timer.data = (unsigned long)dd;
+       setup_timer(&dd->verbs_timer, __verbs_timer, (unsigned long)dd);
+
        dd->verbs_timer.expires = jiffies + 1;
        add_timer(&dd->verbs_timer);
 
@@ -2041,8 +2037,8 @@ int ipath_register_ib_device(struct ipath_devdata *dd)
        dev = &idev->ibdev;
 
        if (dd->ipath_sdma_descq_cnt) {
-               tx = kmalloc(dd->ipath_sdma_descq_cnt * sizeof *tx,
-                            GFP_KERNEL);
+               tx = kmalloc_array(dd->ipath_sdma_descq_cnt, sizeof *tx,
+                                  GFP_KERNEL);
                if (tx == NULL) {
                        ret = -ENOMEM;
                        goto err_tx;
@@ -2075,7 +2071,7 @@ int ipath_register_ib_device(struct ipath_devdata *dd)
         * the LKEY).  The remaining bits act as a generation number or tag.
         */
        idev->lk_table.max = 1 << ib_ipath_lkey_table_size;
-       idev->lk_table.table = kzalloc(idev->lk_table.max *
+       idev->lk_table.table = kcalloc(idev->lk_table.max,
                                       sizeof(*idev->lk_table.table),
                                       GFP_KERNEL);
        if (idev->lk_table.table == NULL) {