[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1407925738-26170-4-git-send-email-thierry.reding@gmail.com>
Date: Wed, 13 Aug 2014 12:28:53 +0200
From: Thierry Reding <thierry.reding@...il.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: Russell King <linux@....linux.org.uk>,
Catalin Marinas <catalin.marinas@....com>,
Stephen Boyd <sboyd@...eaurora.org>,
Sam Ravnborg <sam@...nborg.org>,
linux-arm-kernel@...ts.infradead.org, linux-ia64@...r.kernel.org,
linux-s390@...r.kernel.org, sparclinux@...r.kernel.org,
x86@...nel.org, linux-serial@...r.kernel.org,
linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v4 3/8] sparc: Remove unnecessary volatile usage
From: Thierry Reding <treding@...dia.com>
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@...dia.com>
---
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists