From ef5c16b85b2a6d55ae12a8d7125f3908c8d271d4 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 20 Jan 2016 14:58:32 -0800 Subject: arch/frv/include/asm/io.h: accept const void pointers for read{b,w,l}() The SMD driver is reading and writing chunks of data to iomem, and there's an __iowrite32_copy() function for the writing part, but no __ioread32_copy() function for the reading part. This series adds __ioread32_copy() and uses it in two places. This patch (of 4): The frv port uses compiler builtins, __builtin_read*(), for the I/O read routines. Unfortunately, these don't accept const void pointers although the generic ASM implementations do, so generic code passing const pointers to these APIs cause compilers to emit warnings. Add wrapper functions that cast away the const to avoid the warnings. Signed-off-by: Stephen Boyd Cc: David Howells Cc: Cc: Bjorn Andersson Cc: Hauke Mehrtens Cc: Paul Walmsley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/frv/include/asm/io.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'arch/frv') diff --git a/arch/frv/include/asm/io.h b/arch/frv/include/asm/io.h index 70dfbea..8062fc7 100644 --- a/arch/frv/include/asm/io.h +++ b/arch/frv/include/asm/io.h @@ -43,9 +43,20 @@ static inline unsigned long _swapl(unsigned long v) //#define __iormb() asm volatile("membar") //#define __iowmb() asm volatile("membar") -#define __raw_readb __builtin_read8 -#define __raw_readw __builtin_read16 -#define __raw_readl __builtin_read32 +static inline u8 __raw_readb(const volatile void __iomem *addr) +{ + return __builtin_read8((volatile void __iomem *)addr); +} + +static inline u16 __raw_readw(const volatile void __iomem *addr) +{ + return __builtin_read16((volatile void __iomem *)addr); +} + +static inline u32 __raw_readl(const volatile void __iomem *addr) +{ + return __builtin_read32((volatile void __iomem *)addr); +} #define __raw_writeb(datum, addr) __builtin_write8(addr, datum) #define __raw_writew(datum, addr) __builtin_write16(addr, datum) -- cgit v1.1