From: John Youn Date: Mon, 23 May 2016 18:32:43 +0000 (-0700) Subject: UPSTREAM: usb: dwc3: gadget: Fix usage of bitwise operator X-Git-Tag: firefly_0821_release~1807 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b2c9f6b5dbf09e2200e586b4133b57d1d354c341;p=firefly-linux-kernel-4.4.55.git UPSTREAM: usb: dwc3: gadget: Fix usage of bitwise operator Cleans up the sparse warning: warning: dubious: x | !y Since we do want a bitwise OR here, don't use a logical (true/false) value. Probably is not a real issue but it cleans up the warning. Change-Id: I741c66da3f31a26402334bf5edfd9f969580b64b Signed-off-by: John Youn Signed-off-by: Felipe Balbi Signed-off-by: Wu Liang feng (cherry picked from commit d07fa665c79d85fead080f4b611c3f7645576454) --- diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 6806c8fcc75d..ed7219fc986b 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1802,7 +1802,7 @@ static int dwc3_gadget_init_hw_endpoints(struct dwc3 *dwc, u8 i; for (i = 0; i < num; i++) { - u8 epnum = (i << 1) | (!!direction); + u8 epnum = (i << 1) | (direction ? 1 : 0); dep = kzalloc(sizeof(*dep), GFP_KERNEL); if (!dep)