MIPS: io: fix sparse flood on asm/io.h
authorAlexander Lobakin <alobakin@pm.me>
Sat, 20 Jun 2020 09:34:51 +0000 (09:34 +0000)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Thu, 25 Jun 2020 08:36:39 +0000 (10:36 +0200)
commit7b5f96949da771e4bc47c6dc6de16c5e738635de
tree2285ed77c2be6cf543fa04b13b1dc1e106a8669f
parent3612485bf46e69679716bf55c058cd21b8259fae
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>
arch/mips/include/asm/mach-cavium-octeon/mangle-port.h
arch/mips/include/asm/mach-generic/mangle-port.h
arch/mips/include/asm/mach-ip27/mangle-port.h
arch/mips/include/asm/mach-ip30/mangle-port.h
arch/mips/include/asm/mach-ip32/mangle-port.h
arch/mips/include/asm/mach-tx39xx/mangle-port.h
arch/mips/include/asm/mach-tx49xx/mangle-port.h