On 2025/7/1 16:43, Arnd Bergmann wrote:
> On Tue, Jul 1, 2025, at 10:26, Geert Uytterhoeven wrote:
>> CC arnd

Thanks for CCing Arnd. I missed that.

>>
>> 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>
>>> ---
> 
> I think this one would be a more generic solution,

+1

> does that work for you?

Yeah, that works for me. :)

> 
> --- a/lib/Kconfig
> +++ b/lib/Kconfig
> @@ -381,7 +381,7 @@ config HAS_IOPORT
>  config HAS_IOPORT_MAP
>         bool
>         depends on HAS_IOMEM && !NO_IOPORT_MAP
> -       default y
> +       default HAS_IOPORT
>  
>  source "kernel/dma/Kconfig"
>  
> It seems silly to turn off HAS_IOPORT_MAP on platforms that don't
> have HAS_IOPORT to start with.

I'm not entirely clear on the meaning of HAS_IOPORT though. It looks
HAS_IOPORT was introduced to support disabling compilation of the I/O
accessor functions inb()/outb() and friends [1]. And looking at the
code, xtensa supports IOPORT_MAP [2][3], but doesn't select HAS_IOPORT
(which is also stated in the commit log in [1]).

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fcbfe8121a45152a3cfbe1c28c96a3b611b7347d
[2] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/xtensa/include/asm/io.h?h=v6.16-rc4#n25
[3] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/xtensa/Kconfig?h=v6.16-rc4#n81

Regards,
Tiwei

Reply via email to