Commit 1e57af5 removed macros HWLOC_HAVE_PCI_FIND_CAP,
HWLOC_HAVE_PCIDEV_DOMAIN, and HWLOC_HAVE_LIBPCIACCESS.
However, these are still referenced in src/topology-pci.c.
Specifically, the check to see if HWLOC_HAVE_LIBPCIACCESS or
HWLOC_HAVE_PCIDEV_DOMAIN will always be false, resulting in
domain being set to zero, rather than always being pcidev->domain.

The other change is not a bug, just removal of dead code.
---
 src/topology-pci.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/src/topology-pci.c b/src/topology-pci.c
index f8a3cec..1382025 100644
--- a/src/topology-pci.c
+++ b/src/topology-pci.c
@@ -117,9 +117,6 @@ hwloc_look_pci(struct hwloc_backend *backend)
     unsigned short tmp16;
     char name[128];
     unsigned offset;
-#ifdef HWLOC_HAVE_PCI_FIND_CAP
-    struct pci_cap *cap;
-#endif

     /* initialize the config space in case we fail to read it (missing 
permissions, etc). */
     memset(config_space_cache, 0xff, CONFIG_SPACE_CACHESIZE);
@@ -127,11 +124,7 @@ hwloc_look_pci(struct hwloc_backend *backend)
     pci_device_cfg_read(pcidev, config_space_cache, 0, CONFIG_SPACE_CACHESIZE, 
NULL);

     /* try to read the domain */
-#if (defined HWLOC_HAVE_LIBPCIACCESS) || (defined HWLOC_HAVE_PCIDEV_DOMAIN)
     domain = pcidev->domain;
-#else
-    domain = 0; /* default domain number */
-#endif

     /* try to read the device_class */
     device_class = pcidev->device_class >> 8;
@@ -150,12 +143,7 @@ hwloc_look_pci(struct hwloc_backend *backend)
     obj->attr->pcidev.revision = config_space_cache[PCI_REVISION_ID];

     obj->attr->pcidev.linkspeed = 0; /* unknown */
-#ifdef HWLOC_HAVE_PCI_FIND_CAP
-    cap = pci_find_cap(pcidev, PCI_CAP_ID_EXP, PCI_CAP_NORMAL);
-    offset = cap ? cap->addr : 0;
-#else
     offset = hwloc_pci_find_cap(config_space_cache, PCI_CAP_ID_EXP);
-#endif /* HWLOC_HAVE_PCI_FIND_CAP */

     if (0xffff == pcidev->vendor_id && 0xffff == pcidev->device_id) {
       /* SR-IOV puts ffff:ffff in Virtual Function config space.
-- 
1.7.12.4

Reply via email to