Re: [PATCH for-next 1/4] IB/{hfi1,qib}: Cleanup open coded sge sizing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/28/2018 2:02 PM, Ruhl, Michael J wrote:
b/drivers/infiniband/hw/qib/qib_ud.c
index 4d4c31e..8dab667 100644
--- a/drivers/infiniband/hw/qib/qib_ud.c
+++ b/drivers/infiniband/hw/qib/qib_ud.c
@@ -172,12 +172,8 @@ static void qib_ud_loopback(struct rvt_qp *sqp, struct
rvt_swqe *swqe)
  	ssge.num_sge = swqe->wr.num_sge;
  	sge = &ssge.sge;
  	while (length) {
-		u32 len = sge->length;
+		u32 len = rvt_get_sge_length(sge, length);

-		if (len > length)
-			len = length;
-		if (len > sge->sge_length)
-			len = sge->sge_length;
  		BUG_ON(len == 0);

                ^^^^^^, above you are using WARN_ON_ONCE and below BUG_ON
I assume that everything can be safely removed.

I was focused mainly on patch footprint rather than other
issues and have not focused on the need for the BUG_ON().

I will add this to my list to follow up on this with a different patch.

We have a handful of BUG_ON calls in qib code. I'm ambivalent towards them. Don't think it's worth anyone's time to mess with since they've been there for 10+ years. On the other hand I would happily Ack a patch that removes them.

-Denny



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux