mirror of https://gitee.com/openkylin/linux.git
IB/mlx5: Simplify code by removing return variable
Return variable was set in a line before the actual return was called in begin_wqe function. This patch removes such variable and simplifies the code. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
24be409bee
commit
b2a232d21f
|
@ -3658,12 +3658,8 @@ static int begin_wqe(struct mlx5_ib_qp *qp, void **seg,
|
|||
struct ib_send_wr *wr, unsigned *idx,
|
||||
int *size, int nreq)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
if (unlikely(mlx5_wq_overflow(&qp->sq, nreq, qp->ibqp.send_cq))) {
|
||||
err = -ENOMEM;
|
||||
return err;
|
||||
}
|
||||
if (unlikely(mlx5_wq_overflow(&qp->sq, nreq, qp->ibqp.send_cq)))
|
||||
return -ENOMEM;
|
||||
|
||||
*idx = qp->sq.cur_post & (qp->sq.wqe_cnt - 1);
|
||||
*seg = mlx5_get_send_wqe(qp, *idx);
|
||||
|
@ -3679,7 +3675,7 @@ static int begin_wqe(struct mlx5_ib_qp *qp, void **seg,
|
|||
*seg += sizeof(**ctrl);
|
||||
*size = sizeof(**ctrl) / 16;
|
||||
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void finish_wqe(struct mlx5_ib_qp *qp,
|
||||
|
|
Loading…
Reference in New Issue