Commit 32ec7b36 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by Bjorn Helgaas
Browse files

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: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 469c9cb9
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -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) {
	if (!dev->transparent)
		return;

	pci_bus_for_each_resource(child->parent, res) {
			if (res && res->flags) {
		if (!res || !res->flags)
			continue;

		pci_bus_add_resource(child, res);
				pci_info(dev, "  bridge window %pR (subtractive decode)\n",
					   res);
			}
		}
		pci_info(dev, "  bridge window %pR (subtractive decode)\n", res);
	}
}