From: Jeroen Hofstee Date: Wed, 11 Jun 2014 22:31:27 +0000 (+0200) Subject: usb: xhci: (likely) fix bracket in if condition X-Git-Tag: v2014.07-rc4~12 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=25d1936a192ac62b8df5dc33e37455dcaeb19fae;p=oweals%2Fu-boot.git usb: xhci: (likely) fix bracket in if condition 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 Signed-off-by: Jeroen Hofstee --- diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index d1c2e5c455..59dc096b0c 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -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;