usb: xhci: (likely) fix bracket in if condition
authorJeroen Hofstee <jeroen@myspectrum.nl>
Wed, 11 Jun 2014 22:31:27 +0000 (00:31 +0200)
committerMarek Vasut <marex@denx.de>
Wed, 25 Jun 2014 20:43:16 +0000 (22:43 +0200)
Because of the brackets the & and && is evaluated before
the comparison. This is likely not the intention. Change
it to test the first and second condition to both be true.

cc: Marek Vasut <marex@denx.de>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
drivers/usb/host/xhci.c

index d1c2e5c4551ada7521f077c16e6a8525a2aef5e3..59dc096b0c3200c14c6cc39e9465c9af8e4b7578 100644 (file)
@@ -643,8 +643,8 @@ static int xhci_submit_root(struct usb_device *udev, unsigned long pipe,
        struct xhci_ctrl *ctrl = udev->controller;
        struct xhci_hcor *hcor = ctrl->hcor;
 
-       if (((req->requesttype & USB_RT_PORT) &&
-            le16_to_cpu(req->index)) > CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS) {
+       if ((req->requesttype & USB_RT_PORT) &&
+           le16_to_cpu(req->index) > CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS) {
                printf("The request port(%d) is not configured\n",
                        le16_to_cpu(req->index) - 1);
                return -EINVAL;