staging: brcm80211: reduce sparse messages on brcmsmac sources
authorArend van Spriel <arend@broadcom.com>
Thu, 1 Sep 2011 09:17:11 +0000 (11:17 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Sep 2011 23:39:00 +0000 (16:39 -0700)
Running sparse over the driver sources showed 1356 sparse messages
and quite a number are due to missing __iomem attribute in some
places. This patch reduces the number significantly.

Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmsmac/types.h

index 6d17d7fa9b7b6190fb49735d5990949f4a9d0dc2..cf65f6e7522f2c4b18afd0735976c4fb8a1dc6b9 100644 (file)
@@ -328,13 +328,13 @@ do {                                              \
                __typeof(*(r)) __osl_v; \
                switch (sizeof(*(r))) { \
                case sizeof(u8): \
-                       __osl_v = readb((u8 *)(r)); \
+                       __osl_v = readb((u8 __iomem *)(r)); \
                        break; \
                case sizeof(u16): \
-                       __osl_v = readw((u16 *)(r)); \
+                       __osl_v = readw((u16 __iomem *)(r)); \
                        break; \
                case sizeof(u32): \
-                       __osl_v = readl((u32 *)(r)); \
+                       __osl_v = readl((u32 __iomem *)(r)); \
                        break; \
                } \
                __osl_v; \
@@ -343,13 +343,13 @@ do {                                              \
 #define W_REG(r, v) do { \
                switch (sizeof(*(r))) { \
                case sizeof(u8):        \
-                       writeb((u8)(v), (u8 *)(r)); \
+                       writeb((u8)((v) & 0xFF), (u8 __iomem *)(r)); \
                        break; \
                case sizeof(u16):       \
-                       writew((u16)(v), (u16 *)(r)); \
+                       writew((u16)((v) & 0xFFFF), (u16 __iomem *)(r)); \
                        break; \
                case sizeof(u32):       \
-                       writel((u32)(v), (u32 *)(r)); \
+                       writel((u32)(v), (u32 __iomem *)(r)); \
                        break; \
                } \
        } while (0)