diff mbox series

[v5,2/5] Replace generic memcpy and memset by IO memcpy functions

Message ID 20240924121432.798655-3-jvetter@kalrayinc.com (mailing list archive)
State New, archived
Headers show
Series Consolidate IO memcpy functions | expand

Commit Message

Julian Vetter Sept. 24, 2024, 12:14 p.m. UTC
Some architectures implement their own memcpy_{to,from}io and memset_io
functions, because the generic memcpy_{to,from}io and memset_io just use
memcpy/memset.This commit replaces the generic memcpy/memset functions
by IO memcpy/memset functions that respect the given architectures
alignment constraints. So, later we can get rid of the individual
implementations and use the generic ones.

Reviewed-by: Yann Sionneau <ysionneau@kalrayinc.com>
Signed-off-by: Julian Vetter <jvetter@kalrayinc.com>
---
Changes for v5
- New patch which replaces the "generic" memcpy/memset by our new
  __memset_io/__memcpy_{to,from}io in asm-generic/io.h
---
 include/asm-generic/io.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 9b8e0449da28..3b7deb724a2c 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -1175,7 +1175,7 @@  static inline void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr)
 static inline void memset_io(volatile void __iomem *addr, int value,
 			     size_t size)
 {
-	memset(__io_virt(addr), value, size);
+	__memset_io(__io_virt(addr), value, size);
 }
 #endif
 
@@ -1193,7 +1193,7 @@  static inline void memcpy_fromio(void *buffer,
 				 const volatile void __iomem *addr,
 				 size_t size)
 {
-	memcpy(buffer, __io_virt(addr), size);
+	__memcpy_fromio(buffer, __io_virt(addr), size);
 }
 #endif
 
@@ -1210,7 +1210,7 @@  static inline void memcpy_fromio(void *buffer,
 static inline void memcpy_toio(volatile void __iomem *addr, const void *buffer,
 			       size_t size)
 {
-	memcpy(__io_virt(addr), buffer, size);
+	__memcpy_toio(__io_virt(addr), buffer, size);
 }
 #endif