]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Add for_each_pci_bridge() helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 20 Oct 2017 20:38:54 +0000 (15:38 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 7 Nov 2017 00:48:58 +0000 (18:48 -0600)
commit74381e301e8b1c9e8d1d99560c93948f271194b4
tree22d07a3196b6e8ca3ed23e5b68dcd320488b5ba7
parentf4b02e785683988549d8701625a3fed9a9f2605c
PCI: Add for_each_pci_bridge() helper

The following pattern is often used:

  list_for_each_entry(dev, &bus->devices, bus_list) {
    if (pci_is_bridge(dev)) {
      ...
    }
  }

Add a for_each_pci_bridge() helper to make that code easier to write and
read by reducing indentation level.  It also saves one or few lines of code
in each occurrence.

Convert PCI core parts here at the same time.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[bhelgaas: fold in http://lkml.kernel.org/r/20171013165352.25550-1-andriy.shevchenko@linux.intel.com]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/hotplug/acpiphp_glue.c
drivers/pci/hotplug/cpci_hotplug_pci.c
drivers/pci/hotplug/pciehp_pci.c
drivers/pci/hotplug/shpchp_pci.c
drivers/pci/probe.c
drivers/pci/setup-bus.c
drivers/pcmcia/cardbus.c
include/linux/pci.h