mirror of https://gitee.com/openkylin/linux.git
RDMA/qib: Remove all occurrences of BUG_ON()
QIB driver was added in 2010 with many BUG_ON(), most of them were cleaned out after years of development and usages. It looks like that it is safe now to remove rest of BUG_ONs. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
d12c416dd1
commit
67810e8c3c
|
@ -3237,7 +3237,6 @@ static int init_6120_variables(struct qib_devdata *dd)
|
|||
/* we always allocate at least 2048 bytes for eager buffers */
|
||||
ret = ib_mtu_enum_to_int(qib_ibmtu);
|
||||
dd->rcvegrbufsize = ret != -1 ? max(ret, 2048) : QIB_DEFAULT_MTU;
|
||||
BUG_ON(!is_power_of_2(dd->rcvegrbufsize));
|
||||
dd->rcvegrbufsize_shift = ilog2(dd->rcvegrbufsize);
|
||||
|
||||
qib_6120_tidtemplate(dd);
|
||||
|
|
|
@ -4043,7 +4043,6 @@ static int qib_init_7220_variables(struct qib_devdata *dd)
|
|||
/* we always allocate at least 2048 bytes for eager buffers */
|
||||
ret = ib_mtu_enum_to_int(qib_ibmtu);
|
||||
dd->rcvegrbufsize = ret != -1 ? max(ret, 2048) : QIB_DEFAULT_MTU;
|
||||
BUG_ON(!is_power_of_2(dd->rcvegrbufsize));
|
||||
dd->rcvegrbufsize_shift = ilog2(dd->rcvegrbufsize);
|
||||
|
||||
qib_7220_tidtemplate(dd);
|
||||
|
@ -4252,7 +4251,6 @@ static int init_sdma_7220_regs(struct qib_pportdata *ppd)
|
|||
unsigned word = i / 64;
|
||||
unsigned bit = i & 63;
|
||||
|
||||
BUG_ON(word >= 3);
|
||||
senddmabufmask[word] |= 1ULL << bit;
|
||||
}
|
||||
qib_write_kreg(dd, kr_senddmabufmask0, senddmabufmask[0]);
|
||||
|
|
|
@ -1382,7 +1382,6 @@ static void err_decode(char *msg, size_t len, u64 errs,
|
|||
*msg++ = ',';
|
||||
len--;
|
||||
}
|
||||
BUG_ON(!msp->sz);
|
||||
/* msp->sz counts the nul */
|
||||
took = min_t(size_t, msp->sz - (size_t)1, len);
|
||||
memcpy(msg, msp->msg, took);
|
||||
|
@ -6599,7 +6598,6 @@ static int qib_init_7322_variables(struct qib_devdata *dd)
|
|||
|
||||
/* we always allocate at least 2048 bytes for eager buffers */
|
||||
dd->rcvegrbufsize = max(mtu, 2048);
|
||||
BUG_ON(!is_power_of_2(dd->rcvegrbufsize));
|
||||
dd->rcvegrbufsize_shift = ilog2(dd->rcvegrbufsize);
|
||||
|
||||
qib_7322_tidtemplate(dd);
|
||||
|
@ -6904,7 +6902,6 @@ static int init_sdma_7322_regs(struct qib_pportdata *ppd)
|
|||
unsigned word = erstbuf / BITS_PER_LONG;
|
||||
unsigned bit = erstbuf & (BITS_PER_LONG - 1);
|
||||
|
||||
BUG_ON(word >= 3);
|
||||
senddmabufmask[word] |= 1ULL << bit;
|
||||
}
|
||||
qib_write_kreg_port(ppd, krp_senddmabufmask0, senddmabufmask[0]);
|
||||
|
|
|
@ -209,7 +209,6 @@ struct qib_ctxtdata *qib_create_ctxtdata(struct qib_pportdata *ppd, u32 ctxt,
|
|||
rcd->rcvegrbuf_chunks = (rcd->rcvegrcnt +
|
||||
rcd->rcvegrbufs_perchunk - 1) /
|
||||
rcd->rcvegrbufs_perchunk;
|
||||
BUG_ON(!is_power_of_2(rcd->rcvegrbufs_perchunk));
|
||||
rcd->rcvegrbufs_perchunk_shift =
|
||||
ilog2(rcd->rcvegrbufs_perchunk);
|
||||
}
|
||||
|
|
|
@ -572,7 +572,6 @@ int qib_sdma_verbs_send(struct qib_pportdata *ppd,
|
|||
len = sge->length;
|
||||
if (len > sge->sge_length)
|
||||
len = sge->sge_length;
|
||||
BUG_ON(len == 0);
|
||||
dw = (len + 3) >> 2;
|
||||
addr = dma_map_single(&ppd->dd->pcidev->dev, sge->vaddr,
|
||||
dw << 2, DMA_TO_DEVICE);
|
||||
|
|
|
@ -178,7 +178,6 @@ static void qib_ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe)
|
|||
len = length;
|
||||
if (len > sge->sge_length)
|
||||
len = sge->sge_length;
|
||||
BUG_ON(len == 0);
|
||||
rvt_copy_sge(qp, &qp->r_sge, sge->vaddr, len, true, false);
|
||||
sge->vaddr += len;
|
||||
sge->length -= len;
|
||||
|
|
|
@ -237,7 +237,6 @@ qib_user_sdma_queue_create(struct device *dev, int unit, int ctxt, int sctxt)
|
|||
|
||||
ret = qib_user_sdma_rb_insert(&qib_user_sdma_rb_root,
|
||||
sdma_rb_node);
|
||||
BUG_ON(ret == 0);
|
||||
}
|
||||
pq->sdma_rb_node = sdma_rb_node;
|
||||
|
||||
|
|
|
@ -150,7 +150,6 @@ static u32 qib_count_sge(struct rvt_sge_state *ss, u32 length)
|
|||
len = length;
|
||||
if (len > sge.sge_length)
|
||||
len = sge.sge_length;
|
||||
BUG_ON(len == 0);
|
||||
if (((long) sge.vaddr & (sizeof(u32) - 1)) ||
|
||||
(len != length && (len & (sizeof(u32) - 1)))) {
|
||||
ndesc = 0;
|
||||
|
@ -193,7 +192,6 @@ static void qib_copy_from_sge(void *data, struct rvt_sge_state *ss, u32 length)
|
|||
len = length;
|
||||
if (len > sge->sge_length)
|
||||
len = sge->sge_length;
|
||||
BUG_ON(len == 0);
|
||||
memcpy(data, sge->vaddr, len);
|
||||
sge->vaddr += len;
|
||||
sge->length -= len;
|
||||
|
@ -449,7 +447,6 @@ static void copy_io(u32 __iomem *piobuf, struct rvt_sge_state *ss,
|
|||
len = length;
|
||||
if (len > ss->sge.sge_length)
|
||||
len = ss->sge.sge_length;
|
||||
BUG_ON(len == 0);
|
||||
/* If the source address is not aligned, try to align it. */
|
||||
off = (unsigned long)ss->sge.vaddr & (sizeof(u32) - 1);
|
||||
if (off) {
|
||||
|
|
Loading…
Reference in New Issue