mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
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:
parent
469c9cb941
commit
32ec7b362d
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user