lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241008075023.3052370-8-jvetter@kalrayinc.com>
Date: Tue,  8 Oct 2024 09:50:15 +0200
From: Julian Vetter <jvetter@...rayinc.com>
To: Arnd Bergmann <arnd@...db.de>, Russell King <linux@...linux.org.uk>,
 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>, Geert
 Uytterhoeven <geert@...ux-m68k.org>, Richard Henderson
 <richard.henderson@...aro.org>, Ivan Kokshaysky <ink@...assic.park.msu.ru>,
 Matt Turner <mattst88@...il.com>, "James E . J . Bottomley"
 <James.Bottomley@...senpartnership.com>, Helge Deller <deller@....de>,
 Yoshinori Sato <ysato@...rs.sourceforge.jp>, Rich Felker <dalias@...c.org>,
 John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>, Richard Weinberger
 <richard@....at>, Anton Ivanov <anton.ivanov@...bridgegreys.com>, Johannes
 Berg <johannes@...solutions.net>, Michael Ellerman <mpe@...erman.id.au>,
 Nicholas Piggin <npiggin@...il.com>, Christophe Leroy
 <christophe.leroy@...roup.eu>, Naveen N Rao <naveen@...nel.org>, Madhavan
 Srinivasan <maddy@...ux.ibm.com>, Heiko Carstens <hca@...ux.ibm.com>, Vasily
 Gorbik <gor@...ux.ibm.com>, Alexander Gordeev <agordeev@...ux.ibm.com>,
 Christian Borntraeger <borntraeger@...ux.ibm.com>, Sven Schnelle
 <svens@...ux.ibm.com>, Niklas Schnelle <schnelle@...ux.ibm.com>, Manivannan
 Sadhasivam <manivannan.sadhasivam@...aro.org>, Miquel Raynal
 <miquel.raynal@...tlin.com>, Vignesh Raghavendra <vigneshr@...com>, Jaroslav
 Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
 linux-csky@...r.kernel.org, loongarch@...ts.linux.dev,
 linux-m68k@...ts.linux-m68k.org, linux-alpha@...r.kernel.org,
 linux-parisc@...r.kernel.org, linux-sh@...r.kernel.org,
 linux-um@...ts.infradead.org, linux-arch@...r.kernel.org,
 linuxppc-dev@...ts.ozlabs.org, linux-s390@...r.kernel.org,
 mhi@...ts.linux.dev, linux-arm-msm@...r.kernel.org,
 linux-mtd@...ts.infradead.org, linux-sound@...r.kernel.org, Yann Sionneau
 <ysionneau@...rayinc.com>, Julian Vetter <jvetter@...rayinc.com>
Subject: [PATCH v8 07/14] parisc: Align prototypes of IO memcpy/memset

Align the prototypes of the memcpy_{from,to}io and memset_io functions
with the new ones from iomap_copy.c and remove function declarations,
because they are now declared in asm-generic/io.h.

Reviewed-by: Yann Sionneau <ysionneau@...rayinc.com>
Signed-off-by: Julian Vetter <jvetter@...rayinc.com>
---
Changes for v8:
- Mask the argument with 0xff because now it's an int and not a unsigned
  char anymore
---
 arch/parisc/include/asm/io.h |  3 ---
 arch/parisc/lib/io.c         | 12 ++++++++----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/arch/parisc/include/asm/io.h b/arch/parisc/include/asm/io.h
index a63190af2f05..5cfaa76bb899 100644
--- a/arch/parisc/include/asm/io.h
+++ b/arch/parisc/include/asm/io.h
@@ -135,9 +135,6 @@ 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
diff --git a/arch/parisc/lib/io.c b/arch/parisc/lib/io.c
index 7c00496b47d4..aef9b0124811 100644
--- a/arch/parisc/lib/io.c
+++ b/arch/parisc/lib/io.c
@@ -16,7 +16,7 @@
  * 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)
+void memcpy_toio(volatile void __iomem *dst, const void *src, size_t count)
 {
 	if (((unsigned long)dst & 3) != ((unsigned long)src & 3))
 		goto bytecopy;
@@ -51,7 +51,7 @@ void memcpy_toio(volatile void __iomem *dst, const void *src, int count)
 **      Minimize total number of transfers at cost of CPU cycles.
 **	TODO: only look at src alignment and adjust the stores to dest.
 */
-void memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
+void memcpy_fromio(void *dst, const volatile void __iomem *src, size_t count)
 {
 	/* first compare alignment of src/dst */ 
 	if ( (((unsigned long)dst ^ (unsigned long)src) & 1) || (count < 2) )
@@ -103,9 +103,13 @@ void memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
  * 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)
+void memset_io(volatile void __iomem *addr, int val, size_t count)
 {
-	u32 val32 = (val << 24) | (val << 16) | (val << 8) | val;
+	u32 val32;
+
+	val &= 0xff;
+	val32 = (val << 24) | (val << 16) | (val << 8) | val;
+
 	while ((unsigned long)addr & 3) {
 		writeb(val, addr++);
 		count--;
-- 
2.34.1






Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ