Skip to content

Commit ee17dab

Browse files
committed
pci: factorize multiple calls to filters
Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
1 parent 6ef4413 commit ee17dab

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

hwloc/topology-pci.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,17 +223,13 @@ hwloc_look_pci(struct hwloc_backend *backend, struct hwloc_disc_status *dstatus)
223223

224224
/* filtered? */
225225
if (type == HWLOC_OBJ_PCI_DEVICE) {
226-
enum hwloc_type_filter_e filter;
227-
hwloc_topology_get_type_filter(topology, HWLOC_OBJ_PCI_DEVICE, &filter);
228-
if (filter == HWLOC_TYPE_FILTER_KEEP_NONE)
226+
if (pfilter == HWLOC_TYPE_FILTER_KEEP_NONE)
229227
continue;
230-
if (filter == HWLOC_TYPE_FILTER_KEEP_IMPORTANT
228+
if (pfilter == HWLOC_TYPE_FILTER_KEEP_IMPORTANT
231229
&& !hwloc_filter_check_pcidev_subtype_important(device_class))
232230
continue;
233231
} else if (type == HWLOC_OBJ_BRIDGE) {
234-
enum hwloc_type_filter_e filter;
235-
hwloc_topology_get_type_filter(topology, HWLOC_OBJ_BRIDGE, &filter);
236-
if (filter == HWLOC_TYPE_FILTER_KEEP_NONE)
232+
if (bfilter == HWLOC_TYPE_FILTER_KEEP_NONE)
237233
continue;
238234
/* HWLOC_TYPE_FILTER_KEEP_IMPORTANT filtered later in the core */
239235
}

0 commit comments

Comments
 (0)