aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2013-01-07 08:17:23 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-02-14 09:55:00 -0500
commit7292e7e01cc98fa04a9a3eb7ca11d1bca99c35e9 (patch)
treeae71ffdf66ab42c176aba2cacbf019d5a17a0e4f /include/asm-generic
parent323a72d83c9b2963bd1e46c8e6963e468d4658d7 (diff)
asm-generic/io.h: convert readX defines to functions
E.g. readl is defined like this #define readl(addr) __le32_to_cpu(__raw_readl(addr)) If a there is a readl() call that doesn't check the return value this will cause a compile warning on big endian machines due to the __le32_to_cpu macro magic. E.g. code like this: readl(addr); will generate the following compile warning: warning: value computed is not used [-Wunused-value] With this patch we get rid of dozens of compile warnings on s390. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/io.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 33bbbae4ddc6..8e260cf01351 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -53,8 +53,18 @@ static inline u32 __raw_readl(const volatile void __iomem *addr)
53#endif 53#endif
54 54
55#define readb __raw_readb 55#define readb __raw_readb
56#define readw(addr) __le16_to_cpu(__raw_readw(addr)) 56
57#define readl(addr) __le32_to_cpu(__raw_readl(addr)) 57#define readw readw
58static inline u16 readw(const volatile void __iomem *addr)
59{
60 return __le16_to_cpu(__raw_readw(addr));
61}
62
63#define readl readl
64static inline u32 readl(const volatile void __iomem *addr)
65{
66 return __le32_to_cpu(__raw_readl(addr));
67}
58 68
59#ifndef __raw_writeb 69#ifndef __raw_writeb
60static inline void __raw_writeb(u8 b, volatile void __iomem *addr) 70static inline void __raw_writeb(u8 b, volatile void __iomem *addr)
@@ -89,7 +99,11 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)
89} 99}
90#endif 100#endif
91 101
92#define readq(addr) __le64_to_cpu(__raw_readq(addr)) 102#define readq readq
103static inline u64 readq(const volatile void __iomem *addr)
104{
105 return __le64_to_cpu(__raw_readq(addr));
106}
93 107
94#ifndef __raw_writeq 108#ifndef __raw_writeq
95static inline void __raw_writeq(u64 b, volatile void __iomem *addr) 109static inline void __raw_writeq(u64 b, volatile void __iomem *addr)