Commit 1ac7140f authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] PATCH 2.5.10: set_bit() and friends now need a long paramater

USB set_bit() and friends now need a long paramater

Fixes the set_bit() warnings in the ehci and ohci driver
parent d37407f1
...@@ -91,7 +91,10 @@ ehci_hub_status_data (struct usb_hcd *hcd, char *buf) ...@@ -91,7 +91,10 @@ ehci_hub_status_data (struct usb_hcd *hcd, char *buf)
if (!(temp & PORT_CONNECT)) if (!(temp & PORT_CONNECT))
ehci->reset_done [i] = 0; ehci->reset_done [i] = 0;
if ((temp & (PORT_CSC | PORT_PEC | PORT_OCC)) != 0) { if ((temp & (PORT_CSC | PORT_PEC | PORT_OCC)) != 0) {
set_bit (i, buf); if (i < 7)
buf [0] |= 1 << (i + 1);
else
buf [1] |= 1 << (i - 7);
status = STS_PCD; status = STS_PCD;
} }
} }
...@@ -141,7 +144,7 @@ static int ehci_hub_control ( ...@@ -141,7 +144,7 @@ static int ehci_hub_control (
) { ) {
struct ehci_hcd *ehci = hcd_to_ehci (hcd); struct ehci_hcd *ehci = hcd_to_ehci (hcd);
int ports = HCS_N_PORTS (ehci->hcs_params); int ports = HCS_N_PORTS (ehci->hcs_params);
u32 temp; u32 temp, status;
unsigned long flags; unsigned long flags;
int retval = 0; int retval = 0;
...@@ -219,22 +222,22 @@ static int ehci_hub_control ( ...@@ -219,22 +222,22 @@ static int ehci_hub_control (
if (!wIndex || wIndex > ports) if (!wIndex || wIndex > ports)
goto error; goto error;
wIndex--; wIndex--;
memset (buf, 0, 4); status = 0;
temp = readl (&ehci->regs->port_status [wIndex]); temp = readl (&ehci->regs->port_status [wIndex]);
// wPortChange bits // wPortChange bits
if (temp & PORT_CSC) if (temp & PORT_CSC)
set_bit (USB_PORT_FEAT_C_CONNECTION, buf); status |= 1 << USB_PORT_FEAT_C_CONNECTION;
if (temp & PORT_PEC) if (temp & PORT_PEC)
set_bit (USB_PORT_FEAT_C_ENABLE, buf); status |= 1 << USB_PORT_FEAT_C_ENABLE;
// USB_PORT_FEAT_C_SUSPEND // USB_PORT_FEAT_C_SUSPEND
if (temp & PORT_OCC) if (temp & PORT_OCC)
set_bit (USB_PORT_FEAT_C_OVER_CURRENT, buf); status |= 1 << USB_PORT_FEAT_C_OVER_CURRENT;
/* whoever resets must GetPortStatus to complete it!! */ /* whoever resets must GetPortStatus to complete it!! */
if ((temp & PORT_RESET) if ((temp & PORT_RESET)
&& jiffies > ehci->reset_done [wIndex]) { && jiffies > ehci->reset_done [wIndex]) {
set_bit (USB_PORT_FEAT_C_RESET, buf); status |= 1 << USB_PORT_FEAT_C_RESET;
/* force reset to complete */ /* force reset to complete */
writel (temp & ~PORT_RESET, writel (temp & ~PORT_RESET,
...@@ -252,26 +255,27 @@ static int ehci_hub_control ( ...@@ -252,26 +255,27 @@ static int ehci_hub_control (
// don't show wPortStatus if it's owned by a companion hc // don't show wPortStatus if it's owned by a companion hc
if (!(temp & PORT_OWNER)) { if (!(temp & PORT_OWNER)) {
if (temp & PORT_CONNECT) { if (temp & PORT_CONNECT) {
set_bit (USB_PORT_FEAT_CONNECTION, buf); status |= 1 << USB_PORT_FEAT_CONNECTION;
set_bit (USB_PORT_FEAT_HIGHSPEED, buf); status |= 1 << USB_PORT_FEAT_HIGHSPEED;
} }
if (temp & PORT_PE) if (temp & PORT_PE)
set_bit (USB_PORT_FEAT_ENABLE, buf); status |= 1 << USB_PORT_FEAT_ENABLE;
if (temp & PORT_SUSPEND) if (temp & PORT_SUSPEND)
set_bit (USB_PORT_FEAT_SUSPEND, buf); status |= 1 << USB_PORT_FEAT_SUSPEND;
if (temp & PORT_OC) if (temp & PORT_OC)
set_bit (USB_PORT_FEAT_OVER_CURRENT, buf); status |= 1 << USB_PORT_FEAT_OVER_CURRENT;
if (temp & PORT_RESET) if (temp & PORT_RESET)
set_bit (USB_PORT_FEAT_RESET, buf); status |= 1 << USB_PORT_FEAT_RESET;
if (temp & PORT_POWER) if (temp & PORT_POWER)
set_bit (USB_PORT_FEAT_POWER, buf); status |= 1 << USB_PORT_FEAT_POWER;
} }
#ifndef EHCI_VERBOSE_DEBUG #ifndef EHCI_VERBOSE_DEBUG
if (*(u16*)(buf+2)) /* only if wPortChange is interesting */ if (status & ~0xffff) /* only if wPortChange is interesting */
#endif #endif
dbg_port (hcd, "GetStatus", wIndex + 1, temp); dbg_port (hcd, "GetStatus", wIndex + 1, temp);
cpu_to_le32s ((u32 *) buf); // we "know" this alignment is good, caller used kmalloc()...
*((u32 *) buf) = cpu_to_le32 (status);
break; break;
case SetHubFeature: case SetHubFeature:
switch (wValue) { switch (wValue) {
......
...@@ -96,7 +96,10 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf) ...@@ -96,7 +96,10 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf)
| RH_PS_OCIC | RH_PS_PRSC; | RH_PS_OCIC | RH_PS_PRSC;
if (status) { if (status) {
changed = 1; changed = 1;
set_bit (i + 1, buf); if (i < 7)
buf [0] |= 1 << (i + 1);
else
buf [1] |= 1 << (i - 7);
} }
} }
return changed ? length : 0; return changed ? length : 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment