Thread (13 messages) flat view 13 messages, 4 authors, 2016-07-04

Re: [PATCH 4/6] powerpc/kernel: Clean up some sparse warnings

From: Arnd Bergmann <arnd@arndb.de>
Date: 2016-07-04 07:47:25

On Monday, July 4, 2016 5:09:40 PM CEST Daniel Axtens wrote:
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/kernel/io.c b/arch/powerpc/kernel/io.c
index 2a2b4aeab80f..3f70b7dccee8 100644
--- a/arch/powerpc/kernel/io.c
+++ b/arch/powerpc/kernel/io.c
@@ -37,7 +37,7 @@ void _insb(const volatile u8 __iomem *port, void *buf, long count)
 		return;
 	asm volatile("sync");
 	do {
-		tmp = *port;
+		tmp = *(u8 __force *)port;
 		eieio();
 		*tbuf++ = tmp;
 	} while (--count != 0);
Here the "volatile" is actually meaningful, you should keep it and
just add "__force" in addition.
quoted hunk ↗ jump to hunk
@@ -47,13 +47,13 @@ EXPORT_SYMBOL(_insb);
 
 void _outsb(volatile u8 __iomem *port, const void *buf, long count)
 {
-	const u8 *tbuf = buf;
+	const u8 __force *tbuf = buf;
 
 	if (unlikely(count <= 0))
 		return;
 	asm volatile("sync");
 	do {
-		*port = *tbuf++;
+		*(volatile u8 __force *)port = *tbuf++;
 	} while (--count != 0);
 	asm volatile("sync");
 }
like you correctly do here.
quoted hunk ↗ jump to hunk
@@ -68,7 +68,7 @@ void _insw_ns(const volatile u16 __iomem *port, void *buf, long count)
 		return;
 	asm volatile("sync");
 	do {
-		tmp = *port;
+		tmp = *(u16 __force *)port;
 		eieio();
 		*tbuf++ = tmp;
 	} while (--count != 0);
+volatile
quoted hunk ↗ jump to hunk
@@ -99,7 +99,7 @@ void _insl_ns(const volatile u32 __iomem *port, void *buf, long count)
 		return;
 	asm volatile("sync");
 	do {
-		tmp = *port;
+		tmp = *(u32 __force *)port;
 		eieio();
 		*tbuf++ = tmp;
 	} while (--count != 0);
+volatile


	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help