[PATCH] um: Turn HAS_IOPORT_MAP off

Tiwei Bie tiwei.btw at antgroup.com
Sat Jun 28 09:47:40 PDT 2025


Since we don't have port I/O support, we should turn HAS_IOPORT_MAP
off as well. It will fix clang warnings like below:

./include/asm-generic/io.h:1175:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
 1175 |         return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
      |                                                   ~~~~~~~~~~ ^

Reported-by: kernel test robot <lkp at intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506271049.MtzHqdSd-lkp@intel.com/
Fixes: b8c9c3b822fe ("um: stop using PCI port I/O")
Signed-off-by: Tiwei Bie <tiwei.btw at antgroup.com>
---
Strictly speaking, the -Wnull-pointer-arithmetic warnings reported
by lkp has been fixed by commit b8c9c3b822fe ("um: stop using PCI
port I/O"). But it introduced new -Wnull-pointer-arithmetic warnings,
and this patch fixes the newly introduced warnings.

 arch/um/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index f08e8a7fac93..76aa954520b1 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -54,6 +54,9 @@ config UML_IOMEM_EMULATION
 	select INDIRECT_IOMEM
 	select GENERIC_PCI_IOMAP
 
+config NO_IOPORT_MAP
+	def_bool y
+
 config ISA
 	bool
 
-- 
2.34.1




More information about the linux-um mailing list