Commit 26b1295f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: fix up a bunch of sparse bitwise warnings in the ohci driver

This all because of stupid hardware implementations that can't decide
which endian form they want to run the chip in...
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 425d94d0
...@@ -405,7 +405,7 @@ ohci_hub_descriptor ( ...@@ -405,7 +405,7 @@ ohci_hub_descriptor (
temp |= 0x0010; temp |= 0x0010;
else if (rh & RH_A_OCPM) /* per-port overcurrent reporting? */ else if (rh & RH_A_OCPM) /* per-port overcurrent reporting? */
temp |= 0x0008; temp |= 0x0008;
desc->wHubCharacteristics = cpu_to_hc16 (ohci, temp); desc->wHubCharacteristics = (__force __u16)cpu_to_hc16(ohci, temp);
/* two bitmaps: ports removable, and usb 1.0 legacy PortPwrCtrlMask */ /* two bitmaps: ports removable, and usb 1.0 legacy PortPwrCtrlMask */
rh = roothub_b (ohci); rh = roothub_b (ohci);
...@@ -471,7 +471,7 @@ static void start_hnp(struct ohci_hcd *ohci); ...@@ -471,7 +471,7 @@ static void start_hnp(struct ohci_hcd *ohci);
/* called from some task, normally khubd */ /* called from some task, normally khubd */
static inline void root_port_reset (struct ohci_hcd *ohci, unsigned port) static inline void root_port_reset (struct ohci_hcd *ohci, unsigned port)
{ {
u32 __iomem *portstat = &ohci->regs->roothub.portstatus [port]; __hc32 __iomem *portstat = &ohci->regs->roothub.portstatus [port];
u32 temp; u32 temp;
u16 now = ohci_readl(ohci, &ohci->regs->fmnumber); u16 now = ohci_readl(ohci, &ohci->regs->fmnumber);
u16 reset_done = now + PORT_RESET_MSEC; u16 reset_done = now + PORT_RESET_MSEC;
......
...@@ -510,7 +510,7 @@ static inline void ohci_writel (const struct ohci_hcd *ohci, ...@@ -510,7 +510,7 @@ static inline void ohci_writel (const struct ohci_hcd *ohci,
/* cpu to ohci */ /* cpu to ohci */
static inline __hc16 cpu_to_hc16 (const struct ohci_hcd *ohci, const u16 x) static inline __hc16 cpu_to_hc16 (const struct ohci_hcd *ohci, const u16 x)
{ {
return big_endian(ohci) ? cpu_to_be16(x) : cpu_to_le16(x); return big_endian(ohci) ? (__force __hc16)cpu_to_be16(x) : (__force __hc16)cpu_to_le16(x);
} }
static inline __hc16 cpu_to_hc16p (const struct ohci_hcd *ohci, const u16 *x) static inline __hc16 cpu_to_hc16p (const struct ohci_hcd *ohci, const u16 *x)
...@@ -520,7 +520,7 @@ static inline __hc16 cpu_to_hc16p (const struct ohci_hcd *ohci, const u16 *x) ...@@ -520,7 +520,7 @@ static inline __hc16 cpu_to_hc16p (const struct ohci_hcd *ohci, const u16 *x)
static inline __hc32 cpu_to_hc32 (const struct ohci_hcd *ohci, const u32 x) static inline __hc32 cpu_to_hc32 (const struct ohci_hcd *ohci, const u32 x)
{ {
return big_endian(ohci) ? cpu_to_be32(x) : cpu_to_le32(x); return big_endian(ohci) ? (__force __hc32)cpu_to_be32(x) : (__force __hc32)cpu_to_le32(x);
} }
static inline __hc32 cpu_to_hc32p (const struct ohci_hcd *ohci, const u32 *x) static inline __hc32 cpu_to_hc32p (const struct ohci_hcd *ohci, const u32 *x)
...@@ -531,22 +531,22 @@ static inline __hc32 cpu_to_hc32p (const struct ohci_hcd *ohci, const u32 *x) ...@@ -531,22 +531,22 @@ static inline __hc32 cpu_to_hc32p (const struct ohci_hcd *ohci, const u32 *x)
/* ohci to cpu */ /* ohci to cpu */
static inline u16 hc16_to_cpu (const struct ohci_hcd *ohci, const __hc16 x) static inline u16 hc16_to_cpu (const struct ohci_hcd *ohci, const __hc16 x)
{ {
return big_endian(ohci) ? be16_to_cpu(x) : le16_to_cpu(x); return big_endian(ohci) ? be16_to_cpu((__force __be16)x) : le16_to_cpu((__force __le16)x);
} }
static inline u16 hc16_to_cpup (const struct ohci_hcd *ohci, const __hc16 *x) static inline u16 hc16_to_cpup (const struct ohci_hcd *ohci, const __hc16 *x)
{ {
return big_endian(ohci) ? be16_to_cpup(x) : le16_to_cpup(x); return big_endian(ohci) ? be16_to_cpup((__force __be16 *)x) : le16_to_cpup((__force __le16 *)x);
} }
static inline u32 hc32_to_cpu (const struct ohci_hcd *ohci, const __hc32 x) static inline u32 hc32_to_cpu (const struct ohci_hcd *ohci, const __hc32 x)
{ {
return big_endian(ohci) ? be32_to_cpu(x) : le32_to_cpu(x); return big_endian(ohci) ? be32_to_cpu((__force __be32)x) : le32_to_cpu((__force __le32)x);
} }
static inline u32 hc32_to_cpup (const struct ohci_hcd *ohci, const __hc32 *x) static inline u32 hc32_to_cpup (const struct ohci_hcd *ohci, const __hc32 *x)
{ {
return big_endian(ohci) ? be32_to_cpup(x) : le32_to_cpup(x); return big_endian(ohci) ? be32_to_cpup((__force __be32 *)x) : le32_to_cpup((__force __le32 *)x);
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
......
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