]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
parisc: Remove memcpy_toio and memset_io
authorJulian Vetter <julian@outer-limits.org>
Wed, 4 Dec 2024 08:04:40 +0000 (09:04 +0100)
committerHelge Deller <deller@gmx.de>
Sat, 7 Dec 2024 16:46:09 +0000 (17:46 +0100)
Recently new functions for IO memcpy and IO memset were added in
libs/iomem_copy.c. So, remove the arch specific implementations, to fall
back to the generic ones which do exactly the same. Keep memcpy_fromio
for now, because it's slight more optimized by doing 'u16' accesses if
the buffer is aligned this way.

Signed-off-by: Julian Vetter <julian@outer-limits.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/include/asm/io.h
arch/parisc/kernel/parisc_ksyms.c
arch/parisc/lib/io.c

index a63190af2f055f22374912197e2efc5e36e9a75f..3143cf29ce27b47894af0ef79e305a203ee160c9 100644 (file)
@@ -135,12 +135,8 @@ static inline void gsc_writeq(unsigned long long val, unsigned long addr)
 
 #define pci_iounmap                    pci_iounmap
 
-void memset_io(volatile void __iomem *addr, unsigned char val, int count);
 void memcpy_fromio(void *dst, const volatile void __iomem *src, int count);
-void memcpy_toio(volatile void __iomem *dst, const void *src, int count);
-#define memset_io memset_io
 #define memcpy_fromio memcpy_fromio
-#define memcpy_toio memcpy_toio
 
 /* Port-space IO */
 
index c1587aa35beb6e5f855f006653a5cb5b99d8b8f9..1c366b0d3134b8297d2ce90e66eb4a76966f39a2 100644 (file)
@@ -43,9 +43,7 @@ EXPORT_SYMBOL($global$);
 #endif
 
 #include <asm/io.h>
-EXPORT_SYMBOL(memcpy_toio);
 EXPORT_SYMBOL(memcpy_fromio);
-EXPORT_SYMBOL(memset_io);
 
 extern void $$divI(void);
 extern void $$divU(void);
index 7c00496b47d44fe5f58c04702d42208eeca7d303..7461366a65c97bf05df6a9b711915acc1c5b867f 100644 (file)
 #include <linux/module.h>
 #include <asm/io.h>
 
-/* Copies a block of memory to a device in an efficient manner.
- * Assumes the device can cope with 32-bit transfers.  If it can't,
- * don't use this function.
- */
-void memcpy_toio(volatile void __iomem *dst, const void *src, int count)
-{
-       if (((unsigned long)dst & 3) != ((unsigned long)src & 3))
-               goto bytecopy;
-       while ((unsigned long)dst & 3) {
-               writeb(*(char *)src, dst++);
-               src++;
-               count--;
-       }
-       while (count > 3) {
-               __raw_writel(*(u32 *)src, dst);
-               src += 4;
-               dst += 4;
-               count -= 4;
-       }
- bytecopy:
-       while (count--) {
-               writeb(*(char *)src, dst++);
-               src++;
-       }
-}
-
 /*
 ** Copies a block of memory from a device in an efficient manner.
 ** Assumes the device can cope with 32-bit transfers.  If it can't,
@@ -99,27 +73,6 @@ void memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
        }
 }
 
-/* Sets a block of memory on a device to a given value.
- * Assumes the device can cope with 32-bit transfers.  If it can't,
- * don't use this function.
- */
-void memset_io(volatile void __iomem *addr, unsigned char val, int count)
-{
-       u32 val32 = (val << 24) | (val << 16) | (val << 8) | val;
-       while ((unsigned long)addr & 3) {
-               writeb(val, addr++);
-               count--;
-       }
-       while (count > 3) {
-               __raw_writel(val32, addr);
-               addr += 4;
-               count -= 4;
-       }
-       while (count--) {
-               writeb(val, addr++);
-       }
-}
-
 /*
  * Read COUNT 8-bit bytes from port PORT into memory starting at
  * SRC.