Commit db287ec5 authored by ssh10's avatar ssh10 Committed by Doug Ledford

RDMA/ocrdma: Replace BUG() with BUG_ON()

Replace BUG() with BUG_ON() using coccinelle
Signed-off-by: default avatarShyam Saini <mayhs11saini@gmail.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent b462b06e
...@@ -1170,8 +1170,7 @@ int ocrdma_destroy_cq(struct ib_cq *ibcq) ...@@ -1170,8 +1170,7 @@ int ocrdma_destroy_cq(struct ib_cq *ibcq)
dev->cq_tbl[cq->id] = NULL; dev->cq_tbl[cq->id] = NULL;
indx = ocrdma_get_eq_table_index(dev, cq->eqn); indx = ocrdma_get_eq_table_index(dev, cq->eqn);
if (indx == -EINVAL) BUG_ON(indx == -EINVAL);
BUG();
eq = &dev->eq_tbl[indx]; eq = &dev->eq_tbl[indx];
irq = ocrdma_get_irq(dev, eq); irq = ocrdma_get_irq(dev, eq);
...@@ -1741,8 +1740,7 @@ static void ocrdma_discard_cqes(struct ocrdma_qp *qp, struct ocrdma_cq *cq) ...@@ -1741,8 +1740,7 @@ static void ocrdma_discard_cqes(struct ocrdma_qp *qp, struct ocrdma_cq *cq)
wqe_idx = (le32_to_cpu(cqe->rq.buftag_qpn) >> wqe_idx = (le32_to_cpu(cqe->rq.buftag_qpn) >>
OCRDMA_CQE_BUFTAG_SHIFT) & OCRDMA_CQE_BUFTAG_SHIFT) &
qp->srq->rq.max_wqe_idx; qp->srq->rq.max_wqe_idx;
if (wqe_idx < 1) BUG_ON(wqe_idx < 1);
BUG();
spin_lock_irqsave(&qp->srq->q_lock, flags); spin_lock_irqsave(&qp->srq->q_lock, flags);
ocrdma_hwq_inc_tail(&qp->srq->rq); ocrdma_hwq_inc_tail(&qp->srq->rq);
ocrdma_srq_toggle_bit(qp->srq, wqe_idx - 1); ocrdma_srq_toggle_bit(qp->srq, wqe_idx - 1);
...@@ -2388,15 +2386,13 @@ static int ocrdma_srq_get_idx(struct ocrdma_srq *srq) ...@@ -2388,15 +2386,13 @@ static int ocrdma_srq_get_idx(struct ocrdma_srq *srq)
if (srq->idx_bit_fields[row]) { if (srq->idx_bit_fields[row]) {
indx = ffs(srq->idx_bit_fields[row]); indx = ffs(srq->idx_bit_fields[row]);
indx = (row * 32) + (indx - 1); indx = (row * 32) + (indx - 1);
if (indx >= srq->rq.max_cnt) BUG_ON(indx >= srq->rq.max_cnt);
BUG();
ocrdma_srq_toggle_bit(srq, indx); ocrdma_srq_toggle_bit(srq, indx);
break; break;
} }
} }
if (row == srq->bit_fields_len) BUG_ON(row == srq->bit_fields_len);
BUG();
return indx + 1; /* Use from index 1 */ return indx + 1; /* Use from index 1 */
} }
...@@ -2754,8 +2750,7 @@ static void ocrdma_update_free_srq_cqe(struct ib_wc *ibwc, ...@@ -2754,8 +2750,7 @@ static void ocrdma_update_free_srq_cqe(struct ib_wc *ibwc,
srq = get_ocrdma_srq(qp->ibqp.srq); srq = get_ocrdma_srq(qp->ibqp.srq);
wqe_idx = (le32_to_cpu(cqe->rq.buftag_qpn) >> wqe_idx = (le32_to_cpu(cqe->rq.buftag_qpn) >>
OCRDMA_CQE_BUFTAG_SHIFT) & srq->rq.max_wqe_idx; OCRDMA_CQE_BUFTAG_SHIFT) & srq->rq.max_wqe_idx;
if (wqe_idx < 1) BUG_ON(wqe_idx < 1);
BUG();
ibwc->wr_id = srq->rqe_wr_id_tbl[wqe_idx]; ibwc->wr_id = srq->rqe_wr_id_tbl[wqe_idx];
spin_lock_irqsave(&srq->q_lock, flags); spin_lock_irqsave(&srq->q_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment