[PATCH v4 3/8] sparc: Remove unnecessary volatile usage

From: Thierry Reding
Date: Wed Aug 13 2014 - 06:31:36 EST


From: Thierry Reding <treding@xxxxxxxxxx>

The volatile keyword is only necessary in accessors that immediately
perform memory accesses. Wrappers around such accessors, such as the
_memset_io() and _memcpy_{to,from}io() functions don't need them.

Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
---
Changes in v4:
- new patch

arch/sparc/include/asm/io_32.h | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h
index 9f532902627c..49267f2575d7 100644
--- a/arch/sparc/include/asm/io_32.h
+++ b/arch/sparc/include/asm/io_32.h
@@ -16,18 +16,15 @@

#include <asm-generic/io.h>

-static inline void _memset_io(volatile void __iomem *dst,
- int c, __kernel_size_t n)
+static inline void _memset_io(void __iomem *dst, int c, __kernel_size_t n)
{
- volatile void __iomem *d = dst;
-
while (n--) {
- writeb(c, d);
- d++;
+ writeb(c, dst);
+ dst++;
}
}

-static inline void _memcpy_fromio(void *dst, const volatile void __iomem *src,
+static inline void _memcpy_fromio(void *dst, const void __iomem *src,
__kernel_size_t n)
{
char *d = dst;
@@ -39,16 +36,15 @@ static inline void _memcpy_fromio(void *dst, const volatile void __iomem *src,
}
}

-static inline void _memcpy_toio(volatile void __iomem *dst, const void *src,
+static inline void _memcpy_toio(void __iomem *dst, const void *src,
__kernel_size_t n)
{
const char *s = src;
- volatile void __iomem *d = dst;

while (n--) {
char tmp = *s++;
- writeb(tmp, d);
- d++;
+ writeb(tmp, dst);
+ dst++;
}
}

--
2.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/