diff mbox series

[2/3] hexagon: add memset_io() helper

Message ID 20180406142832.2243021-2-arnd@arndb.de
State New
Headers show
Series [1/3] hexagon: fix ffz/fls/ffs return type | expand

Commit Message

Arnd Bergmann April 6, 2018, 2:28 p.m. UTC
We already have memcpy_toio(), but not memset_io(), so let's
add the obvious version to allow building an allmodconfig kernel
without errors like

drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_move_memcpy':
drivers/gpu/drm/ttm/ttm_bo_util.c:390:3: error: implicit declaration of function 'memset_io' [-Werror=implicit-function-declaration]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 arch/hexagon/include/asm/io.h | 6 ++++++
 1 file changed, 6 insertions(+)

-- 
2.9.0

Comments

Richard Kuo April 8, 2018, 1:31 a.m. UTC | #1
On Fri, Apr 06, 2018 at 04:28:22PM +0200, Arnd Bergmann wrote:
> We already have memcpy_toio(), but not memset_io(), so let's

> add the obvious version to allow building an allmodconfig kernel

> without errors like

> 

> drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_move_memcpy':

> drivers/gpu/drm/ttm/ttm_bo_util.c:390:3: error: implicit declaration of function 'memset_io' [-Werror=implicit-function-declaration]

> 

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> ---

>  arch/hexagon/include/asm/io.h | 6 ++++++

>  1 file changed, 6 insertions(+)

> 

> diff --git a/arch/hexagon/include/asm/io.h b/arch/hexagon/include/asm/io.h

> index 9e8621d94ee9..e17262ad125e 100644

> --- a/arch/hexagon/include/asm/io.h

> +++ b/arch/hexagon/include/asm/io.h

> @@ -216,6 +216,12 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src,

>  	memcpy((void *) dst, src, count);

>  }

>  

> +static inline void memset_io(volatile void __iomem *addr, int value,

> +			     size_t size)

> +{

> +	memset((void __force *)addr, value, size);

> +}

> +

>  #define PCI_IO_ADDR	(volatile void __iomem *)

>  

>  /*


Acked-by: Richard Kuo <rkuo@codeaurora.org>




-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, 
a Linux Foundation Collaborative Project
diff mbox series

Patch

diff --git a/arch/hexagon/include/asm/io.h b/arch/hexagon/include/asm/io.h
index 9e8621d94ee9..e17262ad125e 100644
--- a/arch/hexagon/include/asm/io.h
+++ b/arch/hexagon/include/asm/io.h
@@ -216,6 +216,12 @@  static inline void memcpy_toio(volatile void __iomem *dst, const void *src,
 	memcpy((void *) dst, src, count);
 }
 
+static inline void memset_io(volatile void __iomem *addr, int value,
+			     size_t size)
+{
+	memset((void __force *)addr, value, size);
+}
+
 #define PCI_IO_ADDR	(volatile void __iomem *)
 
 /*