[powerpc:next-test 14/40] arch/powerpc/kernel/pci_32.c:233:5: error: no previous prototype for 'pci_device_from_OF_node'

Pali Rohár pali at kernel.org
Sat Feb 4 06:16:39 AEDT 2023


On Friday 03 February 2023 00:13:02 kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test
> head:   9ffcf6a19dbb2a24de2c2d7b2af1e130986cd565
> commit: 869363998da87c80c16ff1221e95b41b2d3cceb2 [14/40] powerpc/pci: Allow to disable filling deprecated pci-OF-bus-map
> config: powerpc-buildonly-randconfig-r006-20230202 (https://download.01.org/0day-ci/archive/20230203/202302030001.HQPCI490-lkp@intel.com/config)
> compiler: powerpc-linux-gcc (GCC) 12.1.0
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=869363998da87c80c16ff1221e95b41b2d3cceb2
>         git remote add powerpc https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git
>         git fetch --no-tags powerpc next-test
>         git checkout 869363998da87c80c16ff1221e95b41b2d3cceb2
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=powerpc olddefconfig
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash arch/powerpc/kernel/
> 
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp at intel.com>
> 
> All errors (new ones prefixed by >>):
> 
> >> arch/powerpc/kernel/pci_32.c:233:5: error: no previous prototype for 'pci_device_from_OF_node' [-Werror=missing-prototypes]
>      233 | int pci_device_from_OF_node(struct device_node *node, u8 *bus, u8 *devfn)
>          |     ^~~~~~~~~~~~~~~~~~~~~~~
>    cc1: all warnings being treated as errors

Try this change:

diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 82a8981d4c47..b59b6dfb8d4c 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -227,6 +227,7 @@ pci_create_OF_bus_map(void)
 
 #else /* CONFIG_PPC_PCI_OF_BUS_MAP_FILL */
 
+#ifdef CONFIG_PPC_PMAC
 /*
  * Returns the PCI device matching a given OF node without pci_to_OF_bus_map
  */
@@ -248,6 +249,7 @@ int pci_device_from_OF_node(struct device_node *node, u8 *bus, u8 *devfn)
 
 	return 0;
 }
+#endif
 
 #endif /* CONFIG_PPC_PCI_OF_BUS_MAP_FILL */
 

> 
> vim +/pci_device_from_OF_node +233 arch/powerpc/kernel/pci_32.c
> 
>    229	
>    230	/*
>    231	 * Returns the PCI device matching a given OF node without pci_to_OF_bus_map
>    232	 */
>  > 233	int pci_device_from_OF_node(struct device_node *node, u8 *bus, u8 *devfn)
>    234	{
>    235		const __be32 *reg;
>    236		int size;
>    237	
>    238		/* Check if it might have a chance to be a PCI device */
>    239		if (!pci_find_hose_for_OF_device(node))
>    240			return -ENODEV;
>    241	
>    242		reg = of_get_property(node, "reg", &size);
>    243		if (!reg || size < 5 * sizeof(u32))
>    244			return -ENODEV;
>    245	
>    246		*bus = (be32_to_cpup(&reg[0]) >> 16) & 0xff;
>    247		*devfn = (be32_to_cpup(&reg[0]) >> 8) & 0xff;
>    248	
>    249		return 0;
>    250	}
>    251	
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests


More information about the Linuxppc-dev mailing list