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/20241017141111.44612-3-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Ilpo Järvinen 2024-10-17 17:11:10 +03:00 committed by Bjorn Helgaas
parent 469c9cb941
commit 32ec7b362d

View File

@ -543,14 +543,15 @@ void pci_read_bridge_bases(struct pci_bus *child)
pci_read_bridge_mmio(child->self, child->resource[1], false);
pci_read_bridge_mmio_pref(child->self, child->resource[2], false);
if (dev->transparent) {
pci_bus_for_each_resource(child->parent, res) {
if (res && res->flags) {
pci_bus_add_resource(child, res);
pci_info(dev, " bridge window %pR (subtractive decode)\n",
res);
}
}
if (!dev->transparent)
return;
pci_bus_for_each_resource(child->parent, res) {
if (!res || !res->flags)
continue;
pci_bus_add_resource(child, res);
pci_info(dev, " bridge window %pR (subtractive decode)\n", res);
}
}