UPSTREAM: usb: dwc3: gadget: Fix usage of bitwise operator
authorJohn Youn <johnyoun@synopsys.com>
Mon, 23 May 2016 18:32:43 +0000 (11:32 -0700)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 16 Aug 2016 12:48:19 +0000 (20:48 +0800)
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 <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit d07fa665c79d85fead080f4b611c3f7645576454)

drivers/usb/dwc3/gadget.c

index 6806c8fcc75dd38d83bdacc6abcf6b338f3e4a65..ed7219fc986b25f4842079bcf5c739ba2d3fecde 100644 (file)
@@ -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)