RDMA/irdma: Remove the redundant variable
authorZhu Yanjun <yanjun.zhu@linux.dev>
Wed, 23 Mar 2022 23:01:35 +0000 (19:01 -0400)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 4 Apr 2022 13:50:24 +0000 (10:50 -0300)
In the function irdma_puda_get_next_send_wqe, the variable wqe
is not necessary. So remove it.

Link: https://lore.kernel.org/r/20220323230135.291813-1-yanjun.zhu@intel.com
Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/irdma/puda.c

index 397f3d070f904cd8ddd8f4e233046b395928ed59..4ec9639f1bdbf2b28499b1977b083f64432dd245 100644 (file)
@@ -191,7 +191,6 @@ static void irdma_puda_dele_buf(struct irdma_sc_dev *dev,
 static __le64 *irdma_puda_get_next_send_wqe(struct irdma_qp_uk *qp,
                                            u32 *wqe_idx)
 {
-       __le64 *wqe = NULL;
        int ret_code = 0;
 
        *wqe_idx = IRDMA_RING_CURRENT_HEAD(qp->sq_ring);
@@ -199,11 +198,9 @@ static __le64 *irdma_puda_get_next_send_wqe(struct irdma_qp_uk *qp,
                qp->swqe_polarity = !qp->swqe_polarity;
        IRDMA_RING_MOVE_HEAD(qp->sq_ring, ret_code);
        if (ret_code)
-               return wqe;
-
-       wqe = qp->sq_base[*wqe_idx].elem;
+               return NULL;
 
-       return wqe;
+       return qp->sq_base[*wqe_idx].elem;
 }
 
 /**