From: Arend van Spriel Date: Thu, 1 Sep 2011 09:17:11 +0000 (+0200) Subject: staging: brcm80211: reduce sparse messages on brcmsmac sources X-Git-Tag: firefly_0821_release~3680^2~4313^2^2~660 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bc1275218c999d14b876689454e06412d1740806;p=firefly-linux-kernel-4.4.55.git staging: brcm80211: reduce sparse messages on brcmsmac sources 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 Reviewed-by: Roland Vossen Reviewed-by: Pieter-Paul Giesberts Signed-off-by: Roland Vossen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/brcm80211/brcmsmac/types.h b/drivers/staging/brcm80211/brcmsmac/types.h index 6d17d7fa9b7b..cf65f6e7522f 100644 --- a/drivers/staging/brcm80211/brcmsmac/types.h +++ b/drivers/staging/brcm80211/brcmsmac/types.h @@ -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)