[pci:pci/resource 2/2] drivers/pci/probe.c:981:30: error: incompatible function pointer types passing 'int (void *, struct list_head *, struct list_head *)' to parameter of type 'list_cmp_func_t' (aka 'int (*)(void *, const struct list_head *, const struct list_head *)')

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/resource
head:   276b15de528734e8321d1367c634ecda3d143d71
commit: 276b15de528734e8321d1367c634ecda3d143d71 [2/2] PCI: Coalesce host bridge contiguous apertures
config: powerpc64-randconfig-r016-20210526 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 6505c630407c5feec818f0bb1c284f9eeebf2071)
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
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?id=276b15de528734e8321d1367c634ecda3d143d71
        git remote add pci https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
        git fetch --no-tags pci pci/resource
        git checkout 276b15de528734e8321d1367c634ecda3d143d71
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> drivers/pci/probe.c:981:30: error: incompatible function pointer types passing 'int (void *, struct list_head *, struct list_head *)' to parameter of type 'list_cmp_func_t' (aka 'int (*)(void *, const struct list_head *, const struct list_head *)') [-Werror,-Wincompatible-function-pointer-types]
           list_sort(NULL, &resources, res_cmp);
                                       ^~~~~~~
   include/linux/list_sort.h:13:68: note: passing argument to parameter 'cmp' here
   void list_sort(void *priv, struct list_head *head, list_cmp_func_t cmp);
                                                                      ^
   1 error generated.


vim +981 drivers/pci/probe.c

   920	
   921		b = pci_find_bus(pci_domain_nr(bus), bridge->busnr);
   922		if (b) {
   923			/* Ignore it if we already got here via a different bridge */
   924			dev_dbg(&b->dev, "bus already known\n");
   925			err = -EEXIST;
   926			goto free;
   927		}
   928	
   929		dev_set_name(&bridge->dev, "pci%04x:%02x", pci_domain_nr(bus),
   930			     bridge->busnr);
   931	
   932		err = pcibios_root_bridge_prepare(bridge);
   933		if (err)
   934			goto free;
   935	
   936		err = device_add(&bridge->dev);
   937		if (err) {
   938			put_device(&bridge->dev);
   939			goto free;
   940		}
   941		bus->bridge = get_device(&bridge->dev);
   942		device_enable_async_suspend(bus->bridge);
   943		pci_set_bus_of_node(bus);
   944		pci_set_bus_msi_domain(bus);
   945		if (bridge->msi_domain && !dev_get_msi_domain(&bus->dev))
   946			bus->bus_flags |= PCI_BUS_FLAGS_NO_MSI;
   947	
   948		if (!parent)
   949			set_dev_node(bus->bridge, pcibus_to_node(bus));
   950	
   951		bus->dev.class = &pcibus_class;
   952		bus->dev.parent = bus->bridge;
   953	
   954		dev_set_name(&bus->dev, "%04x:%02x", pci_domain_nr(bus), bus->number);
   955		name = dev_name(&bus->dev);
   956	
   957		err = device_register(&bus->dev);
   958		if (err)
   959			goto unregister;
   960	
   961		pcibios_add_bus(bus);
   962	
   963		if (bus->ops->add_bus) {
   964			err = bus->ops->add_bus(bus);
   965			if (WARN_ON(err < 0))
   966				dev_err(&bus->dev, "failed to add bus: %d\n", err);
   967		}
   968	
   969		/* Create legacy_io and legacy_mem files for this bus */
   970		pci_create_legacy_files(bus);
   971	
   972		if (parent)
   973			dev_info(parent, "PCI host bridge to bus %s\n", name);
   974		else
   975			pr_info("PCI host bridge to bus %s\n", name);
   976	
   977		if (nr_node_ids > 1 && pcibus_to_node(bus) == NUMA_NO_NODE)
   978			dev_warn(&bus->dev, "Unknown NUMA node; performance will be reduced\n");
   979	
   980		/* Sort and coalesce contiguous windows */
 > 981		list_sort(NULL, &resources, res_cmp);
   982		resource_list_for_each_entry_safe(window, n, &resources) {
   983			if (list_is_last(&window->node, &resources))
   984				break;
   985	
   986			next = list_next_entry(window, node);
   987			offset = window->offset;
   988			res = window->res;
   989			next_offset = next->offset;
   990			next_res = next->res;
   991	
   992			if (res->flags != next_res->flags || offset != next_offset)
   993				continue;
   994	
   995			if (res->end + 1 == next_res->start) {
   996				next_res->start = res->start;
   997				res->flags = res->start = res->end = 0;
   998			}
   999		}
  1000	
  1001		/* Add initial resources to the bus */
  1002		resource_list_for_each_entry_safe(window, n, &resources) {
  1003			offset = window->offset;
  1004			res = window->res;
  1005			if (!res->end)
  1006				continue;
  1007	
  1008			list_move_tail(&window->node, &bridge->windows);
  1009	
  1010			if (res->flags & IORESOURCE_BUS)
  1011				pci_bus_insert_busn_res(bus, bus->number, res->end);
  1012			else
  1013				pci_bus_add_resource(bus, res, 0);
  1014	
  1015			if (offset) {
  1016				if (resource_type(res) == IORESOURCE_IO)
  1017					fmt = " (bus address [%#06llx-%#06llx])";
  1018				else
  1019					fmt = " (bus address [%#010llx-%#010llx])";
  1020	
  1021				snprintf(addr, sizeof(addr), fmt,
  1022					 (unsigned long long)(res->start - offset),
  1023					 (unsigned long long)(res->end - offset));
  1024			} else
  1025				addr[0] = '\0';
  1026	
  1027			dev_info(&bus->dev, "root bus resource %pR%s\n", res, addr);
  1028		}
  1029	
  1030		down_write(&pci_bus_sem);
  1031		list_add_tail(&bus->node, &pci_root_buses);
  1032		up_write(&pci_bus_sem);
  1033	
  1034		return 0;
  1035	
  1036	unregister:
  1037		put_device(&bridge->dev);
  1038		device_del(&bridge->dev);
  1039	
  1040	free:
  1041		kfree(bus);
  1042		return err;
  1043	}
  1044	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux