]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: dwc3: gadget: get rid of the length variable
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Fri, 6 Apr 2018 12:51:49 +0000 (15:51 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 21 May 2018 07:00:57 +0000 (10:00 +0300)
Code is just as readable without it.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/gadget.c

index 263f9506102f02247add82fa48751b89af6000ee..a4ba5d3a5332f7eaf7fabbdfb4d831ca57a68017 100644 (file)
@@ -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);
@@ -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) {