[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240924092223.534040-3-jvetter@kalrayinc.com>
Date: Tue, 24 Sep 2024 11:22:20 +0200
From: Julian Vetter <jvetter@...rayinc.com>
To: Arnd Bergmann <arnd@...db.de>, Catalin Marinas
<catalin.marinas@....com>, Will Deacon <will@...nel.org>, Guo Ren
<guoren@...nel.org>, Huacai Chen <chenhuacai@...nel.org>, WANG Xuerui
<kernel@...0n.name>, Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-csky@...r.kernel.org, loongarch@...ts.linux.dev, Yann Sionneau
<ysionneau@...rayinc.com>, Julian Vetter <jvetter@...rayinc.com>
Subject: [PATCH v4 2/5] Replace generic memcpy and memset by IO memcpy
functions
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@...rayinc.com>
Signed-off-by: Julian Vetter <jvetter@...rayinc.com>
---
include/asm-generic/io.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 80de699bf6af..0f05d2399938 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -1163,7 +1163,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
@@ -1181,7 +1181,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
@@ -1198,7 +1198,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
--
2.34.1
Powered by blists - more mailing lists