Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ARM] Add a common typesafe __io implementation

As Al did for Versatile in 2ad4f86b60b649fd7428265c08d73a3bd360c81b,
add a typesafe __io implementation for platforms to use. Convert
platforms to use this new simple typesafe implementation.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Russell King and committed by
Russell King
0560cf5a cd32a48d

+44 -65
+8
arch/arm/include/asm/io.h
··· 80 80 extern void __readwrite_bug(const char *fn); 81 81 82 82 /* 83 + * A typesafe __io() helper 84 + */ 85 + static inline void __iomem *__typesafe_io(unsigned long addr) 86 + { 87 + return (void __iomem *)addr; 88 + } 89 + 90 + /* 83 91 * Now, pick up the machine-defined IO definitions 84 92 */ 85 93 #include <mach/io.h>
+2 -2
arch/arm/mach-aaec2000/include/mach/io.h
··· 12 12 * We don't actually have real ISA nor PCI buses, but there is so many 13 13 * drivers out there that might just work if we fake them... 14 14 */ 15 - #define __io(a) ((void __iomem *)(a)) 16 - #define __mem_pci(a) (a) 15 + #define __io(a) __typesafe_io(a) 16 + #define __mem_pci(a) (a) 17 17 18 18 #endif
+2 -2
arch/arm/mach-at91/include/mach/io.h
··· 23 23 24 24 #define IO_SPACE_LIMIT 0xFFFFFFFF 25 25 26 - #define __io(a) ((void __iomem *)(a)) 27 - #define __mem_pci(a) (a) 26 + #define __io(a) __typesafe_io(a) 27 + #define __mem_pci(a) (a) 28 28 29 29 30 30 #ifndef __ASSEMBLY__
+2 -2
arch/arm/mach-clps711x/include/mach/io.h
··· 22 22 23 23 #define IO_SPACE_LIMIT 0xffffffff 24 24 25 - #define __io(a) ((void __iomem *)(a)) 26 - #define __mem_pci(a) (a) 25 + #define __io(a) __typesafe_io(a) 26 + #define __mem_pci(a) (a) 27 27 28 28 /* 29 29 * We don't support ins[lb]/outs[lb]. Make them fault.
+1 -2
arch/arm/mach-davinci/include/mach/io.h
··· 29 29 * We don't actually have real ISA nor PCI buses, but there is so many 30 30 * drivers out there that might just work if we fake them... 31 31 */ 32 - #define PCIO_BASE 0 33 - #define __io(a) ((void __iomem *)(PCIO_BASE + (a))) 32 + #define __io(a) __typesafe_io(a) 34 33 #define __mem_pci(a) (a) 35 34 #define __mem_isa(a) (a) 36 35
+2 -2
arch/arm/mach-ep93xx/include/mach/io.h
··· 4 4 5 5 #define IO_SPACE_LIMIT 0xffffffff 6 6 7 - #define __io(p) ((void __iomem *)(p)) 8 - #define __mem_pci(p) (p) 7 + #define __io(p) __typesafe_io(p) 8 + #define __mem_pci(p) (p)
+1 -1
arch/arm/mach-h720x/include/mach/io.h
··· 16 16 17 17 #define IO_SPACE_LIMIT 0xffffffff 18 18 19 - #define __io(a) ((void __iomem *)(a)) 19 + #define __io(a) __typesafe_io(a) 20 20 #define __mem_pci(a) (a) 21 21 22 22 #endif
+1 -1
arch/arm/mach-imx/include/mach/io.h
··· 22 22 23 23 #define IO_SPACE_LIMIT 0xffffffff 24 24 25 - #define __io(a) ((void __iomem *)(a)) 25 + #define __io(a) __typesafe_io(a) 26 26 #define __mem_pci(a) (a) 27 27 28 28 #endif
+1 -1
arch/arm/mach-ixp4xx/include/mach/io.h
··· 239 239 240 240 #ifndef CONFIG_PCI 241 241 242 - #define __io(v) v 242 + #define __io(v) __typesafe_io(v) 243 243 244 244 #else 245 245
+2 -2
arch/arm/mach-ks8695/include/mach/io.h
··· 13 13 14 14 #define IO_SPACE_LIMIT 0xffffffff 15 15 16 - #define __io(a) ((void __iomem *)(a)) 17 - #define __mem_pci(a) (a) 16 + #define __io(a) __typesafe_io(a) 17 + #define __mem_pci(a) (a) 18 18 19 19 #endif
+2 -6
arch/arm/mach-l7200/include/mach/io.h
··· 15 15 /* 16 16 * There are not real ISA nor PCI buses, so we fake it. 17 17 */ 18 - static inline void __iomem *__io(unsigned long addr) 19 - { 20 - return (void __iomem *)addr; 21 - } 22 - #define __io(a) __io(a) 23 - #define __mem_pci(a) (a) 18 + #define __io(a) __typesafe_io(a) 19 + #define __mem_pci(a) (a) 24 20 25 21 #endif
+2 -2
arch/arm/mach-lh7a40x/include/mach/io.h
··· 14 14 #define IO_SPACE_LIMIT 0xffffffff 15 15 16 16 /* No ISA or PCI bus on this machine. */ 17 - #define __io(a) ((void __iomem *)(a)) 18 - #define __mem_pci(a) (a) 17 + #define __io(a) __typesafe_io(a) 18 + #define __mem_pci(a) (a) 19 19 20 20 #endif /* __ASM_ARCH_IO_H */
+1 -5
arch/arm/mach-msm/include/mach/io.h
··· 23 23 24 24 void __iomem *__msm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype); 25 25 26 - static inline void __iomem *__io(unsigned long addr) 27 - { 28 - return (void __iomem *)addr; 29 - } 30 - #define __io(a) __io(a) 26 + #define __io(a) __typesafe_io(a) 31 27 #define __mem_pci(a) (a) 32 28 33 29 #endif
+1 -1
arch/arm/mach-netx/include/mach/io.h
··· 22 22 23 23 #define IO_SPACE_LIMIT 0xffffffff 24 24 25 - #define __io(a) ((void __iomem *)(a)) 25 + #define __io(a) __typesafe_io(a) 26 26 #define __mem_pci(a) (a) 27 27 28 28 #endif
+1 -1
arch/arm/mach-ns9xxx/include/mach/io.h
··· 13 13 14 14 #define IO_SPACE_LIMIT 0xffffffff /* XXX */ 15 15 16 - #define __io(a) ((void __iomem *)(a)) 16 + #define __io(a) __typesafe_io(a) 17 17 #define __mem_pci(a) (a) 18 18 #define __mem_isa(a) (IO_BASE + (a)) 19 19
+1 -6
arch/arm/mach-orion5x/include/mach/io.h
··· 38 38 __iounmap(addr); 39 39 } 40 40 41 - static inline void __iomem *__io(unsigned long addr) 42 - { 43 - return (void __iomem *)addr; 44 - } 45 - 46 41 #define __arch_ioremap(p, s, m) __arch_ioremap(p, s, m) 47 42 #define __arch_iounmap(a) __arch_iounmap(a) 48 - #define __io(a) __io(a) 43 + #define __io(a) __typesafe_io(a) 49 44 #define __mem_pci(a) (a) 50 45 51 46
+2 -2
arch/arm/mach-pnx4008/include/mach/io.h
··· 15 15 16 16 #define IO_SPACE_LIMIT 0xffffffff 17 17 18 - #define __io(a) ((void __iomem *)(a)) 19 - #define __mem_pci(a) (a) 18 + #define __io(a) __typesafe_io(a) 19 + #define __mem_pci(a) (a) 20 20 21 21 #endif
+2 -2
arch/arm/mach-pxa/include/mach/io.h
··· 12 12 * We don't actually have real ISA nor PCI buses, but there is so many 13 13 * drivers out there that might just work if we fake them... 14 14 */ 15 - #define __io(a) ((void __iomem *)(a)) 16 - #define __mem_pci(a) (a) 15 + #define __io(a) __typesafe_io(a) 16 + #define __mem_pci(a) (a) 17 17 18 18 #endif
+2 -7
arch/arm/mach-realview/include/mach/io.h
··· 22 22 23 23 #define IO_SPACE_LIMIT 0xffffffff 24 24 25 - static inline void __iomem *__io(unsigned long addr) 26 - { 27 - return (void __iomem *)addr; 28 - } 29 - 30 - #define __io(a) __io(a) 31 - #define __mem_pci(a) (a) 25 + #define __io(a) __typesafe_io(a) 26 + #define __mem_pci(a) (a) 32 27 33 28 #endif
+2 -6
arch/arm/mach-sa1100/include/mach/io.h
··· 16 16 * We don't actually have real ISA nor PCI buses, but there is so many 17 17 * drivers out there that might just work if we fake them... 18 18 */ 19 - static inline void __iomem *__io(unsigned long addr) 20 - { 21 - return (void __iomem *)addr; 22 - } 23 - #define __io(a) __io(a) 24 - #define __mem_pci(a) (a) 19 + #define __io(a) __typesafe_io(a) 20 + #define __mem_pci(a) (a) 25 21 26 22 #endif
+2 -6
arch/arm/mach-versatile/include/mach/io.h
··· 22 22 23 23 #define IO_SPACE_LIMIT 0xffffffff 24 24 25 - static inline void __iomem *__io(unsigned long addr) 26 - { 27 - return (void __iomem *)addr; 28 - } 29 - #define __io(a) __io(a) 30 - #define __mem_pci(a) (a) 25 + #define __io(a) __typesafe_io(a) 26 + #define __mem_pci(a) (a) 31 27 32 28 #endif
+2 -2
arch/arm/plat-mxc/include/mach/io.h
··· 35 35 #endif 36 36 37 37 /* io address mapping macro */ 38 - #define __io(a) ((void __iomem *)(a)) 38 + #define __io(a) __typesafe_io(a) 39 39 40 - #define __mem_pci(a) (a) 40 + #define __mem_pci(a) (a) 41 41 42 42 #endif
+2 -4
arch/arm/plat-omap/include/mach/io.h
··· 42 42 * We don't actually have real ISA nor PCI buses, but there is so many 43 43 * drivers out there that might just work if we fake them... 44 44 */ 45 - #define __io(a) ((void __iomem *)(PCIO_BASE + (a))) 46 - #define __mem_pci(a) (a) 45 + #define __io(a) __typesafe_io(a) 46 + #define __mem_pci(a) (a) 47 47 48 48 /* 49 49 * ---------------------------------------------------------------------------- 50 50 * I/O mapping 51 51 * ---------------------------------------------------------------------------- 52 52 */ 53 - 54 - #define PCIO_BASE 0 55 53 56 54 #if defined(CONFIG_ARCH_OMAP1) 57 55