Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f8245b4 authored by Felipe Balbi's avatar Felipe Balbi
Browse files

usb: dwc3: gadget: always decrement by 1



We need to decrement in both cases (enq > deq and
enq < deq)

Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 696fe69d
Loading
Loading
Loading
Loading
+1 −4
Original line number Original line Diff line number Diff line
@@ -884,12 +884,9 @@ static u32 dwc3_calc_trbs_left(struct dwc3_ep *dep)
		return DWC3_TRB_NUM - 1;
		return DWC3_TRB_NUM - 1;
	}
	}


	trbs_left = dep->trb_dequeue - dep->trb_enqueue;
	trbs_left = dep->trb_dequeue - dep->trb_enqueue - 1;
	trbs_left &= (DWC3_TRB_NUM - 1);
	trbs_left &= (DWC3_TRB_NUM - 1);


	if (dep->trb_dequeue < dep->trb_enqueue)
		trbs_left--;

	return trbs_left;
	return trbs_left;
}
}