From: kernel test robot <lkp@intel.com>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: kbuild-all@lists.01.org, linux-pci@vger.kernel.org,
Bjorn Helgaas <helgaas@kernel.org>
Subject: [pci:pci/resource 2/2] drivers/pci/probe.c:981:30: error: passing argument 3 of 'list_sort' from incompatible pointer type
Date: Fri, 28 May 2021 09:09:02 +0800 [thread overview]
Message-ID: <202105280956.CBsJM4Qy-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 6033 bytes --]
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: x86_64-randconfig-s022-20210527 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# 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
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/pci/probe.c: In function 'pci_register_host_bridge':
>> drivers/pci/probe.c:981:30: error: passing argument 3 of 'list_sort' from incompatible pointer type [-Werror=incompatible-pointer-types]
981 | list_sort(NULL, &resources, res_cmp);
| ^~~~~~~
| |
| int (*)(void *, struct list_head *, struct list_head *)
In file included from drivers/pci/probe.c:22:
include/linux/list_sort.h:13:68: note: expected 'list_cmp_func_t' {aka 'int (*)(void *, const struct list_head *, const struct list_head *)'} but argument is of type 'int (*)(void *, struct list_head *, struct list_head *)'
13 | void list_sort(void *priv, struct list_head *head, list_cmp_func_t cmp);
| ~~~~~~~~~~~~~~~~^~~
cc1: some warnings being treated as errors
vim +/list_sort +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@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30473 bytes --]
reply other threads:[~2021-05-28 1:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202105280956.CBsJM4Qy-lkp@intel.com \
--to=lkp@intel.com \
--cc=helgaas@kernel.org \
--cc=kai.heng.feng@canonical.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).