usb: dwc3: gadget: Fix usage of bitwise operator
authorJohn Youn <johnyoun@synopsys.com>
Mon, 23 May 2016 18:32:43 +0000 (11:32 -0700)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 20 Jun 2016 09:32:42 +0000 (12:32 +0300)
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.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/gadget.c

index 6a18b3d0dccfcecc10cde5d679a7b1b37c2bbc5b..f38db3b79d3fe01a7e0b281e43dfaf2722437c48 100644 (file)
@@ -1798,7 +1798,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)