Commit 348e026f authored by Moiz Sonasath's avatar Moiz Sonasath Committed by Felipe Balbi

usb: dwc3: gadget: Fix sparse warnings

This patch fixes the following sparse warnings:

drivers/usb/dwc3/gadget.c:1096:7: warning: symbol 'ret' shadows an earlier one
drivers/usb/dwc3/gadget.c:1058:8: originally declared here
drivers/usb/dwc3/gadget.c:1100:16: warning: symbol 'dwc' shadows an earlier one
drivers/usb/dwc3/gadget.c:1057:15: originally declared here
drivers/usb/dwc3/gadget.c:1118:16: warning: symbol 'dwc' shadows an earlier one
drivers/usb/dwc3/gadget.c:1057:15: originally declared here
drivers/usb/dwc3/gadget.c:1800:19: warning: symbol 'dep' shadows an earlier one
drivers/usb/dwc3/gadget.c:1778:18: originally declared here

Also, fix the potential checkpatch errors around the if() loops that
this fix patch can create.
Signed-off-by: default avatarMoiz Sonasath <m-sonasath@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 2dfe37d4
...@@ -1092,16 +1092,11 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) ...@@ -1092,16 +1092,11 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
* *
*/ */
if (dep->flags & DWC3_EP_PENDING_REQUEST) { if (dep->flags & DWC3_EP_PENDING_REQUEST) {
int ret;
ret = __dwc3_gadget_kick_transfer(dep, 0, true); ret = __dwc3_gadget_kick_transfer(dep, 0, true);
if (ret && ret != -EBUSY) { if (ret && ret != -EBUSY)
struct dwc3 *dwc = dep->dwc;
dev_dbg(dwc->dev, "%s: failed to kick transfers\n", dev_dbg(dwc->dev, "%s: failed to kick transfers\n",
dep->name); dep->name);
} }
}
/* /*
* 2. XferInProgress on Isoc EP with an active transfer. We need to * 2. XferInProgress on Isoc EP with an active transfer. We need to
...@@ -1113,13 +1108,10 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) ...@@ -1113,13 +1108,10 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
WARN_ON_ONCE(!dep->resource_index); WARN_ON_ONCE(!dep->resource_index);
ret = __dwc3_gadget_kick_transfer(dep, dep->resource_index, ret = __dwc3_gadget_kick_transfer(dep, dep->resource_index,
false); false);
if (ret && ret != -EBUSY) { if (ret && ret != -EBUSY)
struct dwc3 *dwc = dep->dwc;
dev_dbg(dwc->dev, "%s: failed to kick transfers\n", dev_dbg(dwc->dev, "%s: failed to kick transfers\n",
dep->name); dep->name);
} }
}
/* /*
* 3. Missed ISOC Handling. We need to start isoc transfer on the saved * 3. Missed ISOC Handling. We need to start isoc transfer on the saved
...@@ -1755,7 +1747,7 @@ static void dwc3_endpoint_transfer_complete(struct dwc3 *dwc, ...@@ -1755,7 +1747,7 @@ static void dwc3_endpoint_transfer_complete(struct dwc3 *dwc,
int i; int i;
for (i = 0; i < DWC3_ENDPOINTS_NUM; i++) { for (i = 0; i < DWC3_ENDPOINTS_NUM; i++) {
struct dwc3_ep *dep = dwc->eps[i]; dep = dwc->eps[i];
if (!(dep->flags & DWC3_EP_ENABLED)) if (!(dep->flags & DWC3_EP_ENABLED))
continue; continue;
......
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