diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-10-01 22:03:45 +0200 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2011-10-08 21:03:07 +0800 |
commit | 97b09da4ee36ec4bd0f6e16b84b4bb6fa05db110 (patch) | |
tree | 34c80d050a0cc8538d0fc22213772560dc3db2f3 /arch/arm/mach-pxa/include/mach/hardware.h | |
parent | 7272889d3f40ed6aa2ade32bed5834789b3299cc (diff) | |
download | talos-obmc-linux-97b09da4ee36ec4bd0f6e16b84b4bb6fa05db110.tar.gz talos-obmc-linux-97b09da4ee36ec4bd0f6e16b84b4bb6fa05db110.zip |
ARM: pxa: use correct __iomem annotations
This tries to clear up the confusion between integers and iomem pointers
in the marvell pxa platform. MMIO addresses are supposed to be __iomem*
values, in order to let the Linux type checking work correctly. This
patch moves the cast to __iomem as far back as possible, to the place
where the MMIO virtual address windows are defined.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/include/mach/hardware.h')
-rw-r--r-- | arch/arm/mach-pxa/include/mach/hardware.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h index de63ca3016b4..8184669dde28 100644 --- a/arch/arm/mach-pxa/include/mach/hardware.h +++ b/arch/arm/mach-pxa/include/mach/hardware.h @@ -36,22 +36,23 @@ * Note that not all PXA2xx chips implement all those addresses, and the * kernel only maps the minimum needed range of this mapping. */ -#define io_p2v(x) (0xf2000000 + ((x) & 0x01ffffff) + (((x) & 0x1c000000) >> 1)) #define io_v2p(x) (0x3c000000 + ((x) & 0x01ffffff) + (((x) & 0x0e000000) << 1)) +#define io_p2v(x) IOMEM(0xf2000000 + ((x) & 0x01ffffff) + (((x) & 0x1c000000) >> 1)) #ifndef __ASSEMBLY__ - -# define __REG(x) (*((volatile u32 *)io_p2v(x))) +# define IOMEM(x) ((void __iomem *)(x)) +# define __REG(x) (*((volatile u32 __iomem *)io_p2v(x))) /* With indexed regs we don't want to feed the index through io_p2v() especially if it is a variable, otherwise horrible code will result. */ # define __REG2(x,y) \ - (*(volatile u32 *)((u32)&__REG(x) + (y))) + (*(volatile u32 __iomem*)((u32)&__REG(x) + (y))) # define __PREG(x) (io_v2p((u32)&(x))) #else +# define IOMEM(x) x # define __REG(x) io_p2v(x) # define __PREG(x) io_v2p(x) |