Skip to content

Commit

Permalink
usb: dwc3: gadget: get rid of the length variable
Browse files Browse the repository at this point in the history
Code is just as readable without it.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
  • Loading branch information
Felipe Balbi committed May 21, 2018
1 parent fee73e6 commit 6d9d22d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -2315,10 +2315,8 @@ static void dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep,
struct dwc3_request *tmp;

list_for_each_entry_safe(req, tmp, &dep->started_list, list) {
unsigned length;
int ret;

length = req->request.length;
if (req->num_pending_sgs)
ret = dwc3_gadget_ep_reclaim_trb_sg(dep, req, event,
status);
Expand All @@ -2333,7 +2331,7 @@ static void dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep,
req->zero = false;
}

req->request.actual = length - req->remaining;
req->request.actual = req->request.length - req->remaining;

if (!dwc3_gadget_ep_request_completed(req) ||
req->num_pending_sgs) {
Expand Down

0 comments on commit 6d9d22d

Please sign in to comment.