CC arnd

On Sat, 28 Jun 2025 at 18:48, Tiwei Bie <tiwei....@antgroup.com> wrote:
> 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 <l...@intel.com>
> Closes: 
> https://lore.kernel.org/oe-kbuild-all/202506271049.mtzhqdsd-...@intel.com/
> Fixes: b8c9c3b822fe ("um: stop using PCI port I/O")
> Signed-off-by: Tiwei Bie <tiwei....@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
>

Reply via email to