Skip to content
Commit d6e10bf2 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Felipe Balbi
Browse files

usb: dwc3: avoid -Wmaybe-uninitialized warning



Cleaning up the loop in dwc3_cleanup_done_reqs() introduced a
gcc warning if built with "-Wmaybe-uninitialized":

drivers/usb/dwc3/gadget.c: In function 'dwc3_endpoint_transfer_complete':
drivers/usb/dwc3/gadget.c:2015:9: 'trb' may be used uninitialized in this function [-Wmaybe-uninitialized]

I believe it is a false positive and we always have a valid 'trb'
pointer at the end of the function, but neither I nor the compiler
are able to prove that.

This works around the warning by computing a flag earlier in the function
when it's guaranteed to be valid, which tells the compiler that it's
safe and makes it easier to understand to me.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Fixes: 31162af4 ("usb: dwc3: gadget: avoid while (1) loop on completion")
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent c9ffc787
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment