drivers/pci/pci.c:4195 pci_pio_to_address() warn: unsigned 'pio' is never less than zero.

From: kernel test robot
Date: Mon Sep 11 2023 - 18:00:51 EST


Hi Bjorn,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
commit: 3b59ca944687b8651849f51b15c23e3fdbf07394 PCI: Simplify pci_pio_to_address()
date: 2 weeks ago
config: openrisc-randconfig-r071-20230906 (https://download.01.org/0day-ci/archive/20230912/202309120432.dJjt8xMp-lkp@xxxxxxxxx/config)
compiler: or1k-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230912/202309120432.dJjt8xMp-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309120432.dJjt8xMp-lkp@xxxxxxxxx/

smatch warnings:
drivers/pci/pci.c:4195 pci_pio_to_address() warn: unsigned 'pio' is never less than zero.

vim +/pio +4195 drivers/pci/pci.c

4191
4192 phys_addr_t pci_pio_to_address(unsigned long pio)
4193 {
4194 #ifdef PCI_IOBASE
> 4195 if (pio < MMIO_UPPER_LIMIT)
4196 return logic_pio_to_hwaddr(pio);
4197 #endif
4198
4199 return (phys_addr_t) OF_BAD_ADDR;
4200 }
4201 EXPORT_SYMBOL_GPL(pci_pio_to_address);
4202

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki