aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2011-11-03 05:32:20 -0400
committerFelipe Balbi <balbi@ti.com>2011-12-12 04:48:32 -0500
commitd39ee7be2aaf0a53d7b5f43c13571bac95f7cc0c (patch)
tree496dab55cdf0d1467bd23764fc687d78bbefc7e7 /drivers/usb/dwc3/gadget.c
parent5bdb1dcc63304a407e70020c1118fca1642bebaa (diff)
usb: dwc3: gadget: return early in dwc3_cleanup_done_reqs()
This patch avoids the compiler spitting out the following warning: |drivers/usb/dwc3/gadget.c:1304: warning: 'trb' is used uninitialized \ in this function This is only uninitialized if the list of to-cleanup TRBs is empty which should not be the case because we call this functions once a transfer completed so it should be on list. In order to make the warning disappear we return early. This should never happen and the WARN_ON_ONCE(1) is there in case it happens so we can investigate what went wrong. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 9497fa5e3921..85cf392365cb 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1308,8 +1308,10 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep,
1308 1308
1309 do { 1309 do {
1310 req = next_request(&dep->req_queued); 1310 req = next_request(&dep->req_queued);
1311 if (!req) 1311 if (!req) {
1312 break; 1312 WARN_ON_ONCE(1);
1313 return 1;
1314 }
1313 1315
1314 dwc3_trb_to_nat(req->trb, &trb); 1316 dwc3_trb_to_nat(req->trb, &trb);
1315 1317