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

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
...@@ -884,12 +884,9 @@ static u32 dwc3_calc_trbs_left(struct dwc3_ep *dep) ...@@ -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;
} }
......
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