diff options
author | Laura Abbott <lauraa@codeaurora.org> | 2013-05-16 14:40:22 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-05-22 19:09:44 -0400 |
commit | 9b97173e785a54c5df0aa23d1e1f680f61e36e43 (patch) | |
tree | e84f3017f6c642d3e1ec6f4ad2a56d6c44206283 /arch | |
parent | 3b656fed6ff65d6d268da9ed0760c2a58d125771 (diff) |
ARM: 7728/1: mm: Use phys_addr_t properly for ioremap functions
Several of the ioremap functions use unsigned long in places
resulting in truncation if physical addresses greater than
4G are passed in. Change the types of the functions and the
callers accordingly.
Cc: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/io.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-ebsa110/core.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/mm-imx3.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-iop13xx/io.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/common.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-msm/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-msm/io.c | 2 | ||||
-rw-r--r-- | arch/arm/mm/ioremap.c | 10 | ||||
-rw-r--r-- | arch/arm/mm/nommu.c | 6 |
9 files changed, 18 insertions, 18 deletions
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 652b56086de7..d070741b2b37 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h | |||
@@ -130,16 +130,16 @@ static inline u32 __raw_readl(const volatile void __iomem *addr) | |||
130 | */ | 130 | */ |
131 | extern void __iomem *__arm_ioremap_pfn_caller(unsigned long, unsigned long, | 131 | extern void __iomem *__arm_ioremap_pfn_caller(unsigned long, unsigned long, |
132 | size_t, unsigned int, void *); | 132 | size_t, unsigned int, void *); |
133 | extern void __iomem *__arm_ioremap_caller(unsigned long, size_t, unsigned int, | 133 | extern void __iomem *__arm_ioremap_caller(phys_addr_t, size_t, unsigned int, |
134 | void *); | 134 | void *); |
135 | 135 | ||
136 | extern void __iomem *__arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int); | 136 | extern void __iomem *__arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int); |
137 | extern void __iomem *__arm_ioremap(unsigned long, size_t, unsigned int); | 137 | extern void __iomem *__arm_ioremap(phys_addr_t, size_t, unsigned int); |
138 | extern void __iomem *__arm_ioremap_exec(unsigned long, size_t, bool cached); | 138 | extern void __iomem *__arm_ioremap_exec(phys_addr_t, size_t, bool cached); |
139 | extern void __iounmap(volatile void __iomem *addr); | 139 | extern void __iounmap(volatile void __iomem *addr); |
140 | extern void __arm_iounmap(volatile void __iomem *addr); | 140 | extern void __arm_iounmap(volatile void __iomem *addr); |
141 | 141 | ||
142 | extern void __iomem * (*arch_ioremap_caller)(unsigned long, size_t, | 142 | extern void __iomem * (*arch_ioremap_caller)(phys_addr_t, size_t, |
143 | unsigned int, void *); | 143 | unsigned int, void *); |
144 | extern void (*arch_iounmap)(volatile void __iomem *); | 144 | extern void (*arch_iounmap)(volatile void __iomem *); |
145 | 145 | ||
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c index b13cc74114db..8a53f346cdb3 100644 --- a/arch/arm/mach-ebsa110/core.c +++ b/arch/arm/mach-ebsa110/core.c | |||
@@ -116,7 +116,7 @@ static void __init ebsa110_map_io(void) | |||
116 | iotable_init(ebsa110_io_desc, ARRAY_SIZE(ebsa110_io_desc)); | 116 | iotable_init(ebsa110_io_desc, ARRAY_SIZE(ebsa110_io_desc)); |
117 | } | 117 | } |
118 | 118 | ||
119 | static void __iomem *ebsa110_ioremap_caller(unsigned long cookie, size_t size, | 119 | static void __iomem *ebsa110_ioremap_caller(phys_addr_t cookie, size_t size, |
120 | unsigned int flags, void *caller) | 120 | unsigned int flags, void *caller) |
121 | { | 121 | { |
122 | return (void __iomem *)cookie; | 122 | return (void __iomem *)cookie; |
diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c index e0e69a682174..eed32ca0b8ab 100644 --- a/arch/arm/mach-imx/mm-imx3.c +++ b/arch/arm/mach-imx/mm-imx3.c | |||
@@ -65,7 +65,7 @@ static void imx3_idle(void) | |||
65 | : "=r" (reg)); | 65 | : "=r" (reg)); |
66 | } | 66 | } |
67 | 67 | ||
68 | static void __iomem *imx3_ioremap_caller(unsigned long phys_addr, size_t size, | 68 | static void __iomem *imx3_ioremap_caller(phys_addr_t phys_addr, size_t size, |
69 | unsigned int mtype, void *caller) | 69 | unsigned int mtype, void *caller) |
70 | { | 70 | { |
71 | if (mtype == MT_DEVICE) { | 71 | if (mtype == MT_DEVICE) { |
diff --git a/arch/arm/mach-iop13xx/io.c b/arch/arm/mach-iop13xx/io.c index 183dc8b5511b..faaf7d4482c5 100644 --- a/arch/arm/mach-iop13xx/io.c +++ b/arch/arm/mach-iop13xx/io.c | |||
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | #include "pci.h" | 24 | #include "pci.h" |
25 | 25 | ||
26 | static void __iomem *__iop13xx_ioremap_caller(unsigned long cookie, | 26 | static void __iomem *__iop13xx_ioremap_caller(phys_addr_t cookie, |
27 | size_t size, unsigned int mtype, void *caller) | 27 | size_t size, unsigned int mtype, void *caller) |
28 | { | 28 | { |
29 | void __iomem * retval; | 29 | void __iomem * retval; |
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 6600cff6bd92..d7223b3b81f3 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -559,7 +559,7 @@ void ixp4xx_restart(char mode, const char *cmd) | |||
559 | * fallback to the default. | 559 | * fallback to the default. |
560 | */ | 560 | */ |
561 | 561 | ||
562 | static void __iomem *ixp4xx_ioremap_caller(unsigned long addr, size_t size, | 562 | static void __iomem *ixp4xx_ioremap_caller(phys_addr_t addr, size_t size, |
563 | unsigned int mtype, void *caller) | 563 | unsigned int mtype, void *caller) |
564 | { | 564 | { |
565 | if (!is_pci_memory(addr)) | 565 | if (!is_pci_memory(addr)) |
diff --git a/arch/arm/mach-msm/common.h b/arch/arm/mach-msm/common.h index ce8215a269e5..421cf7751a80 100644 --- a/arch/arm/mach-msm/common.h +++ b/arch/arm/mach-msm/common.h | |||
@@ -23,7 +23,7 @@ extern void msm_map_msm8x60_io(void); | |||
23 | extern void msm_map_msm8960_io(void); | 23 | extern void msm_map_msm8960_io(void); |
24 | extern void msm_map_qsd8x50_io(void); | 24 | extern void msm_map_qsd8x50_io(void); |
25 | 25 | ||
26 | extern void __iomem *__msm_ioremap_caller(unsigned long phys_addr, size_t size, | 26 | extern void __iomem *__msm_ioremap_caller(phys_addr_t phys_addr, size_t size, |
27 | unsigned int mtype, void *caller); | 27 | unsigned int mtype, void *caller); |
28 | 28 | ||
29 | extern struct smp_operations msm_smp_ops; | 29 | extern struct smp_operations msm_smp_ops; |
diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c index 123ef9cbce1b..fd65b6d42cde 100644 --- a/arch/arm/mach-msm/io.c +++ b/arch/arm/mach-msm/io.c | |||
@@ -172,7 +172,7 @@ void __init msm_map_msm7x30_io(void) | |||
172 | } | 172 | } |
173 | #endif /* CONFIG_ARCH_MSM7X30 */ | 173 | #endif /* CONFIG_ARCH_MSM7X30 */ |
174 | 174 | ||
175 | void __iomem *__msm_ioremap_caller(unsigned long phys_addr, size_t size, | 175 | void __iomem *__msm_ioremap_caller(phys_addr_t phys_addr, size_t size, |
176 | unsigned int mtype, void *caller) | 176 | unsigned int mtype, void *caller) |
177 | { | 177 | { |
178 | if (mtype == MT_DEVICE) { | 178 | if (mtype == MT_DEVICE) { |
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index 04d9006eab1f..f123d6eb074b 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c | |||
@@ -331,10 +331,10 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn, | |||
331 | return (void __iomem *) (offset + addr); | 331 | return (void __iomem *) (offset + addr); |
332 | } | 332 | } |
333 | 333 | ||
334 | void __iomem *__arm_ioremap_caller(unsigned long phys_addr, size_t size, | 334 | void __iomem *__arm_ioremap_caller(phys_addr_t phys_addr, size_t size, |
335 | unsigned int mtype, void *caller) | 335 | unsigned int mtype, void *caller) |
336 | { | 336 | { |
337 | unsigned long last_addr; | 337 | phys_addr_t last_addr; |
338 | unsigned long offset = phys_addr & ~PAGE_MASK; | 338 | unsigned long offset = phys_addr & ~PAGE_MASK; |
339 | unsigned long pfn = __phys_to_pfn(phys_addr); | 339 | unsigned long pfn = __phys_to_pfn(phys_addr); |
340 | 340 | ||
@@ -367,12 +367,12 @@ __arm_ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size, | |||
367 | } | 367 | } |
368 | EXPORT_SYMBOL(__arm_ioremap_pfn); | 368 | EXPORT_SYMBOL(__arm_ioremap_pfn); |
369 | 369 | ||
370 | void __iomem * (*arch_ioremap_caller)(unsigned long, size_t, | 370 | void __iomem * (*arch_ioremap_caller)(phys_addr_t, size_t, |
371 | unsigned int, void *) = | 371 | unsigned int, void *) = |
372 | __arm_ioremap_caller; | 372 | __arm_ioremap_caller; |
373 | 373 | ||
374 | void __iomem * | 374 | void __iomem * |
375 | __arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype) | 375 | __arm_ioremap(phys_addr_t phys_addr, size_t size, unsigned int mtype) |
376 | { | 376 | { |
377 | return arch_ioremap_caller(phys_addr, size, mtype, | 377 | return arch_ioremap_caller(phys_addr, size, mtype, |
378 | __builtin_return_address(0)); | 378 | __builtin_return_address(0)); |
@@ -387,7 +387,7 @@ EXPORT_SYMBOL(__arm_ioremap); | |||
387 | * CONFIG_GENERIC_ALLOCATOR for allocating external memory. | 387 | * CONFIG_GENERIC_ALLOCATOR for allocating external memory. |
388 | */ | 388 | */ |
389 | void __iomem * | 389 | void __iomem * |
390 | __arm_ioremap_exec(unsigned long phys_addr, size_t size, bool cached) | 390 | __arm_ioremap_exec(phys_addr_t phys_addr, size_t size, bool cached) |
391 | { | 391 | { |
392 | unsigned int mtype; | 392 | unsigned int mtype; |
393 | 393 | ||
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c index d51225f90ae2..31bd77b1d6df 100644 --- a/arch/arm/mm/nommu.c +++ b/arch/arm/mm/nommu.c | |||
@@ -81,16 +81,16 @@ void __iomem *__arm_ioremap_pfn_caller(unsigned long pfn, unsigned long offset, | |||
81 | return __arm_ioremap_pfn(pfn, offset, size, mtype); | 81 | return __arm_ioremap_pfn(pfn, offset, size, mtype); |
82 | } | 82 | } |
83 | 83 | ||
84 | void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size, | 84 | void __iomem *__arm_ioremap(phys_addr_t phys_addr, size_t size, |
85 | unsigned int mtype) | 85 | unsigned int mtype) |
86 | { | 86 | { |
87 | return (void __iomem *)phys_addr; | 87 | return (void __iomem *)phys_addr; |
88 | } | 88 | } |
89 | EXPORT_SYMBOL(__arm_ioremap); | 89 | EXPORT_SYMBOL(__arm_ioremap); |
90 | 90 | ||
91 | void __iomem * (*arch_ioremap_caller)(unsigned long, size_t, unsigned int, void *); | 91 | void __iomem * (*arch_ioremap_caller)(phys_addr_t, size_t, unsigned int, void *); |
92 | 92 | ||
93 | void __iomem *__arm_ioremap_caller(unsigned long phys_addr, size_t size, | 93 | void __iomem *__arm_ioremap_caller(phys_addr_t phys_addr, size_t size, |
94 | unsigned int mtype, void *caller) | 94 | unsigned int mtype, void *caller) |
95 | { | 95 | { |
96 | return __arm_ioremap(phys_addr, size, mtype); | 96 | return __arm_ioremap(phys_addr, size, mtype); |