parisc: convert (read|write)bwlq to inlines
authorKyle McMartin <kyle@shortfin.cabal.ca>
Mon, 16 Feb 2009 08:05:02 +0000 (03:05 -0500)
committerKyle McMartin <kyle@treachery.i.cabal.ca>
Fri, 13 Mar 2009 05:20:18 +0000 (01:20 -0400)
Kills the 'value computed but not used' due to
leX_to_cpu.

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
arch/parisc/include/asm/io.h

index d3031d1f9d034539ca2ff9999c4dba09743c3576..1fa905ea53de9af1ccc4ede940920a2357d9488d 100644 (file)
@@ -174,15 +174,39 @@ static inline void __raw_writeq(unsigned long long b, volatile void __iomem *add
        *(volatile unsigned long long __force *) addr = b;
 }
 
-/* readb can never be const, so use __fswab instead of le*_to_cpu */
-#define readb(addr) __raw_readb(addr)
-#define readw(addr) le16_to_cpu(__raw_readw(addr))
-#define readl(addr) le32_to_cpu(__raw_readl(addr))
-#define readq(addr) le64_to_cpu(__raw_readq(addr))
-#define writeb(b, addr) __raw_writeb(b, addr)
-#define writew(b, addr) __raw_writew(cpu_to_le16(b), addr)
-#define writel(b, addr) __raw_writel(cpu_to_le32(b), addr)
-#define writeq(b, addr) __raw_writeq(cpu_to_le64(b), addr)
+static inline unsigned char readb(const volatile void __iomem *addr)
+{
+       return __raw_readb(addr);
+}
+static inline unsigned short readw(const volatile void __iomem *addr)
+{
+       return le16_to_cpu(__raw_readw(addr));
+}
+static inline unsigned int readl(const volatile void __iomem *addr)
+{
+       return le32_to_cpu(__raw_readl(addr));
+}
+static inline unsigned long long readq(const volatile void __iomem *addr)
+{
+       return le64_to_cpu(__raw_readq(addr));
+}
+
+static inline void writeb(unsigned char b, volatile void __iomem *addr)
+{
+       __raw_writeb(b, addr);
+}
+static inline void writew(unsigned short w, volatile void __iomem *addr)
+{
+       __raw_writew(cpu_to_le16(w), addr);
+}
+static inline void writel(unsigned int l, volatile void __iomem *addr)
+{
+       __raw_writel(cpu_to_le32(l), addr);
+}
+static inline void writeq(unsigned long long q, volatile void __iomem *addr)
+{
+       __raw_writeq(cpu_to_le64(q), addr);
+}
 
 #define readb_relaxed(addr) readb(addr)
 #define readw_relaxed(addr) readw(addr)