diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-20 11:25:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-20 11:25:44 -0400 |
commit | af52739b922f656eb1f39016fabaabe4baeda2e2 (patch) | |
tree | 79a7aa810d0493cd0cf4adebac26d37f12e8b545 /drivers/usb/host/ehci-hub.c | |
parent | 25ed6a5e97809129a1bc852b6b5c7d03baa112c4 (diff) | |
parent | 33688abb2802ff3a230bd2441f765477b94cc89e (diff) |
Merge 4.7-rc4 into staging-next
We want the fixes in here, and we can resolve a merge issue in
drivers/iio/industrialio-trigger.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-hub.c')
-rw-r--r-- | drivers/usb/host/ehci-hub.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index ffc90295a95f..74f62d68f013 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
@@ -872,15 +872,23 @@ int ehci_hub_control( | |||
872 | ) { | 872 | ) { |
873 | struct ehci_hcd *ehci = hcd_to_ehci (hcd); | 873 | struct ehci_hcd *ehci = hcd_to_ehci (hcd); |
874 | int ports = HCS_N_PORTS (ehci->hcs_params); | 874 | int ports = HCS_N_PORTS (ehci->hcs_params); |
875 | u32 __iomem *status_reg = &ehci->regs->port_status[ | 875 | u32 __iomem *status_reg, *hostpc_reg; |
876 | (wIndex & 0xff) - 1]; | ||
877 | u32 __iomem *hostpc_reg = &ehci->regs->hostpc[(wIndex & 0xff) - 1]; | ||
878 | u32 temp, temp1, status; | 876 | u32 temp, temp1, status; |
879 | unsigned long flags; | 877 | unsigned long flags; |
880 | int retval = 0; | 878 | int retval = 0; |
881 | unsigned selector; | 879 | unsigned selector; |
882 | 880 | ||
883 | /* | 881 | /* |
882 | * Avoid underflow while calculating (wIndex & 0xff) - 1. | ||
883 | * The compiler might deduce that wIndex can never be 0 and then | ||
884 | * optimize away the tests for !wIndex below. | ||
885 | */ | ||
886 | temp = wIndex & 0xff; | ||
887 | temp -= (temp > 0); | ||
888 | status_reg = &ehci->regs->port_status[temp]; | ||
889 | hostpc_reg = &ehci->regs->hostpc[temp]; | ||
890 | |||
891 | /* | ||
884 | * FIXME: support SetPortFeatures USB_PORT_FEAT_INDICATOR. | 892 | * FIXME: support SetPortFeatures USB_PORT_FEAT_INDICATOR. |
885 | * HCS_INDICATOR may say we can change LEDs to off/amber/green. | 893 | * HCS_INDICATOR may say we can change LEDs to off/amber/green. |
886 | * (track current state ourselves) ... blink for diagnostics, | 894 | * (track current state ourselves) ... blink for diagnostics, |