Skip to content

Commit 32ec7b3

Browse files
ij-intelbjorn-helgaas
authored andcommitted
PCI: Simplify pci_read_bridge_bases() logic
Use reverse logic combined with return and continue to significantly reduce indentation level in pci_read_bridge_bases(). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]>
1 parent 469c9cb commit 32ec7b3

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

drivers/pci/probe.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -543,14 +543,15 @@ void pci_read_bridge_bases(struct pci_bus *child)
543543
pci_read_bridge_mmio(child->self, child->resource[1], false);
544544
pci_read_bridge_mmio_pref(child->self, child->resource[2], false);
545545

546-
if (dev->transparent) {
547-
pci_bus_for_each_resource(child->parent, res) {
548-
if (res && res->flags) {
549-
pci_bus_add_resource(child, res);
550-
pci_info(dev, " bridge window %pR (subtractive decode)\n",
551-
res);
552-
}
553-
}
546+
if (!dev->transparent)
547+
return;
548+
549+
pci_bus_for_each_resource(child->parent, res) {
550+
if (!res || !res->flags)
551+
continue;
552+
553+
pci_bus_add_resource(child, res);
554+
pci_info(dev, " bridge window %pR (subtractive decode)\n", res);
554555
}
555556
}
556557

0 commit comments

Comments
 (0)