Commit 2c4ce3e6 authored by Benjamin Gray's avatar Benjamin Gray Committed by Michael Ellerman

powerpc: Cast away __iomem in low level IO routines

Sparse reports dereferencing an __iomem pointer. These routines
are clearly low level handlers for IO memory, so force cast away
the __iomem annotation to tell sparse the dereferences are safe.
Signed-off-by: default avatarBenjamin Gray <bgray@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231011053711.93427-11-bgray@linux.ibm.com
parent c6519c6d
...@@ -33,7 +33,7 @@ void _insb(const volatile u8 __iomem *port, void *buf, long count) ...@@ -33,7 +33,7 @@ void _insb(const volatile u8 __iomem *port, void *buf, long count)
return; return;
asm volatile("sync"); asm volatile("sync");
do { do {
tmp = *port; tmp = *(const volatile u8 __force *)port;
eieio(); eieio();
*tbuf++ = tmp; *tbuf++ = tmp;
} while (--count != 0); } while (--count != 0);
...@@ -49,7 +49,7 @@ void _outsb(volatile u8 __iomem *port, const void *buf, long count) ...@@ -49,7 +49,7 @@ void _outsb(volatile u8 __iomem *port, const void *buf, long count)
return; return;
asm volatile("sync"); asm volatile("sync");
do { do {
*port = *tbuf++; *(volatile u8 __force *)port = *tbuf++;
} while (--count != 0); } while (--count != 0);
asm volatile("sync"); asm volatile("sync");
} }
...@@ -64,7 +64,7 @@ void _insw_ns(const volatile u16 __iomem *port, void *buf, long count) ...@@ -64,7 +64,7 @@ void _insw_ns(const volatile u16 __iomem *port, void *buf, long count)
return; return;
asm volatile("sync"); asm volatile("sync");
do { do {
tmp = *port; tmp = *(const volatile u16 __force *)port;
eieio(); eieio();
*tbuf++ = tmp; *tbuf++ = tmp;
} while (--count != 0); } while (--count != 0);
...@@ -80,7 +80,7 @@ void _outsw_ns(volatile u16 __iomem *port, const void *buf, long count) ...@@ -80,7 +80,7 @@ void _outsw_ns(volatile u16 __iomem *port, const void *buf, long count)
return; return;
asm volatile("sync"); asm volatile("sync");
do { do {
*port = *tbuf++; *(volatile u16 __force *)port = *tbuf++;
} while (--count != 0); } while (--count != 0);
asm volatile("sync"); asm volatile("sync");
} }
...@@ -95,7 +95,7 @@ void _insl_ns(const volatile u32 __iomem *port, void *buf, long count) ...@@ -95,7 +95,7 @@ void _insl_ns(const volatile u32 __iomem *port, void *buf, long count)
return; return;
asm volatile("sync"); asm volatile("sync");
do { do {
tmp = *port; tmp = *(const volatile u32 __force *)port;
eieio(); eieio();
*tbuf++ = tmp; *tbuf++ = tmp;
} while (--count != 0); } while (--count != 0);
...@@ -111,7 +111,7 @@ void _outsl_ns(volatile u32 __iomem *port, const void *buf, long count) ...@@ -111,7 +111,7 @@ void _outsl_ns(volatile u32 __iomem *port, const void *buf, long count)
return; return;
asm volatile("sync"); asm volatile("sync");
do { do {
*port = *tbuf++; *(volatile u32 __force *)port = *tbuf++;
} while (--count != 0); } while (--count != 0);
asm volatile("sync"); asm volatile("sync");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment