staging: brcm80211: fixed build issue for big endian platforms
authorRoland Vossen <rvossen@broadcom.com>
Mon, 8 Aug 2011 13:58:22 +0000 (15:58 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Aug 2011 20:00:02 +0000 (13:00 -0700)
Driver now builds for big endian mips platform, possibly also for other
big endian platforms. A change was made to the R_REG and W_REG macro's.
These macro's perform an xor (^) operation for endianess swap purposes.
Gcc complained because an xor operation is not allowed on a pointer type.
Fixed this by casting the pointer to an unsigned long.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmsmac/dma.h
drivers/staging/brcm80211/brcmsmac/types.h

index 3ff109fa3e7e41d8d16a11441b13e458da5b1663..334f2eb3036b6c589958d9c5645412aec632e685 100644 (file)
@@ -17,6 +17,7 @@
 #ifndef        _BRCM_DMA_H_
 #define        _BRCM_DMA_H_
 
+#include <linux/delay.h>
 #include "types.h"             /* forward structure declarations */
 
 /* DMA structure:
index e0880a01fab97690dbed57ba18f468e9b3fe731f..ab97718ea47194b5151ca04df5aa2a12b3f09c52 100644 (file)
@@ -305,11 +305,11 @@ do {                                              \
                switch (sizeof(*(r))) { \
                case sizeof(u8): \
                        __osl_v = \
-                       readb((u8 *)((r)^3)); \
+                       readb((u8 *)((unsigned long)(r)^3)); \
                        break; \
                case sizeof(u16): \
                        __osl_v = \
-                       readw((u16 *)((r)^2)); \
+                       readw((u16 *)((unsigned long)(r)^2)); \
                        break; \
                case sizeof(u32): \
                        __osl_v = readl((u32 *)(r)); \
@@ -322,10 +322,10 @@ do {                                              \
                switch (sizeof(*(r))) { \
                case sizeof(u8):        \
                        writeb((u8)(v), \
-                       (u8 *)((r)^3)); break; \
+                       (u8 *)((unsigned long)(r)^3)); break; \
                case sizeof(u16):       \
                        writew((u16)(v), \
-                       (u16 *)((r)^2)); break; \
+                       (u16 *)((unsigned long)(r)^2)); break; \
                case sizeof(u32):       \
                        writel((u32)(v), \
                        (u32 *)(r)); break; \