Commit d2f607484f8210cf19b1730dee26d426a5a770a5

Authored by Russell King
Committed by Russell King
1 parent 87e807b6c4

[ARM] Fix compiler warnings for memcpy_toio/memcpy_fromio/memset_io

Add 'volatile' to the __iomem pointers for these functions as
per x86.

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

Showing 2 changed files with 6 additions and 6 deletions Side-by-side Diff

arch/arm/kernel/io.c
... ... @@ -7,7 +7,7 @@
7 7 * Copy data from IO memory space to "real" memory space.
8 8 * This needs to be optimized.
9 9 */
10   -void _memcpy_fromio(void *to, void __iomem *from, size_t count)
  10 +void _memcpy_fromio(void *to, const volatile void __iomem *from, size_t count)
11 11 {
12 12 unsigned char *t = to;
13 13 while (count) {
... ... @@ -22,7 +22,7 @@
22 22 * Copy data from "real" memory space to IO memory space.
23 23 * This needs to be optimized.
24 24 */
25   -void _memcpy_toio(void __iomem *to, const void *from, size_t count)
  25 +void _memcpy_toio(volatile void __iomem *to, const void *from, size_t count)
26 26 {
27 27 const unsigned char *f = from;
28 28 while (count) {
... ... @@ -37,7 +37,7 @@
37 37 * "memset" on IO memory space.
38 38 * This needs to be optimized.
39 39 */
40   -void _memset_io(void __iomem *dst, int c, size_t count)
  40 +void _memset_io(volatile void __iomem *dst, int c, size_t count)
41 41 {
42 42 while (count) {
43 43 count--;
include/asm-arm/io.h
... ... @@ -136,9 +136,9 @@
136 136 /*
137 137 * String version of IO memory access ops:
138 138 */
139   -extern void _memcpy_fromio(void *, void __iomem *, size_t);
140   -extern void _memcpy_toio(void __iomem *, const void *, size_t);
141   -extern void _memset_io(void __iomem *, int, size_t);
  139 +extern void _memcpy_fromio(void *, const volatile void __iomem *, size_t);
  140 +extern void _memcpy_toio(volatile void __iomem *, const void *, size_t);
  141 +extern void _memset_io(volatile void __iomem *, int, size_t);
142 142  
143 143 #define mmiowb()
144 144