diff mbox series

[3/3] PCI: Use reverse logic in pci_read_bridge_bases()

Message ID 20241017141111.44612-3-ilpo.jarvinen@linux.intel.com (mailing list archive)
State New
Headers show
Series [1/3] PCI: Remove unused PCI_SUBTRACTIVE_DECODE | expand

Commit Message

Ilpo Järvinen Oct. 17, 2024, 2:11 p.m. UTC
Use reverse logic combined with return and continue to allow
significant reduction in indentation level in pci_read_bridge_bases().

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/pci/probe.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 4243b1e6ece2..cc97dbda7e76 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -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);
 	}
 }