summaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/mach-tx39xx
diff options
context:
space:
mode:
authorAlexander Lobakin <alobakin@pm.me>2020-06-20 11:34:51 +0200
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2020-06-25 10:36:39 +0200
commit7b5f96949da771e4bc47c6dc6de16c5e738635de (patch)
tree2285ed77c2be6cf543fa04b13b1dc1e106a8669f /arch/mips/include/asm/mach-tx39xx
parentMIPS: generic/ip32: io: fix __mem_ioswabq() (diff)
downloadlinux-7b5f96949da771e4bc47c6dc6de16c5e738635de.tar.xz
linux-7b5f96949da771e4bc47c6dc6de16c5e738635de.zip
MIPS: io: fix sparse flood on asm/io.h
MIPS MMIO macros for byteswapping from/to hardware endianness are a bit tricky because they use cpu_to_le{16,32,64}() in both directions. This generates a lot of questions from sparse as __le{16,32,64} types are 'restricted' and direct cast is forbidden in order to prevent messing up the byteorder. As MMIO ops are used in almost every single driver, this leads to console flooding and complicates bug hunting. We could fix it in a more proper way, i.e. separate from device / to device byteswap macros and expand __BUILD_MEMORY_*(), but this seems redundant and will produce code duplication. Instead, just expand the existing *ioswab*() macros with forced typecasting to stop floods. Signed-off-by: Alexander Lobakin <alobakin@pm.me> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/include/asm/mach-tx39xx')
-rw-r--r--arch/mips/include/asm/mach-tx39xx/mangle-port.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/mips/include/asm/mach-tx39xx/mangle-port.h b/arch/mips/include/asm/mach-tx39xx/mangle-port.h
index ab7a70bd895e..95be459950f7 100644
--- a/arch/mips/include/asm/mach-tx39xx/mangle-port.h
+++ b/arch/mips/include/asm/mach-tx39xx/mangle-port.h
@@ -14,11 +14,11 @@ extern unsigned long (*__swizzle_addr_b)(unsigned long port);
#define ioswabb(a, x) (x)
#define __mem_ioswabb(a, x) (x)
-#define ioswabw(a, x) le16_to_cpu(x)
+#define ioswabw(a, x) le16_to_cpu((__force __le16)(x))
#define __mem_ioswabw(a, x) (x)
-#define ioswabl(a, x) le32_to_cpu(x)
+#define ioswabl(a, x) le32_to_cpu((__force __le32)(x))
#define __mem_ioswabl(a, x) (x)
-#define ioswabq(a, x) le64_to_cpu(x)
+#define ioswabq(a, x) le64_to_cpu((__force __le64)(x))
#define __mem_ioswabq(a, x) (x)
#endif /* __ASM_MACH_TX39XX_MANGLE_PORT_H */