diff options
author | Nicholas Johnson <nicholas.johnson-opensource@outlook.com.au> | 2020-01-28 22:57:09 +0100 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2020-01-29 23:56:57 +0100 |
commit | 7779385484dad7c95b624f7c9ee1aa07ab8cf43b (patch) | |
tree | c0546e9d0cf97814bc7abbdc9bcb04a88118dbda /drivers/pci/setup-bus.c | |
parent | PCI: Pass size + alignment to pci_bus_distribute_available_resources() (diff) | |
download | linux-7779385484dad7c95b624f7c9ee1aa07ab8cf43b.tar.xz linux-7779385484dad7c95b624f7c9ee1aa07ab8cf43b.zip |
PCI: Remove local variable usage in pci_bus_distribute_available_resources()
In pci_bus_distribute_available_resources(), use resource_size() rather
than the local available_io, etc. No functional change intended; this just
makes the preceding patch smaller.
[bhelgaas: extracted from https://lore.kernel.org/r/PSXP216MB0438587C47CBEDF365B1EA27803C0@PSXP216MB0438.KORP216.PROD.OUTLOOK.COM]
Signed-off-by: Nicholas Johnson <nicholas.johnson-opensource@outlook.com.au>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/pci/setup-bus.c')
-rw-r--r-- | drivers/pci/setup-bus.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 7fa7ad1c3407..336c96c1d2d5 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -1886,14 +1886,10 @@ static void pci_bus_distribute_available_resources(struct pci_bus *bus, * calculated in __pci_bus_size_bridges() which covers all the * devices currently connected to the port and below. */ - available_io = resource_size(&io); - available_mmio = resource_size(&mmio); - available_mmio_pref = resource_size(&mmio_pref); - - extend_bridge_window(bridge, io_res, add_list, available_io); - extend_bridge_window(bridge, mmio_res, add_list, available_mmio); + extend_bridge_window(bridge, io_res, add_list, resource_size(&io)); + extend_bridge_window(bridge, mmio_res, add_list, resource_size(&mmio)); extend_bridge_window(bridge, mmio_pref_res, add_list, - available_mmio_pref); + resource_size(&mmio_pref)); /* * Calculate how many hotplug bridges and normal bridges there @@ -1929,9 +1925,9 @@ static void pci_bus_distribute_available_resources(struct pci_bus *bus, * extra space reduced by the minimal required space for the * non-hotplug bridges. */ - remaining_io = available_io; - remaining_mmio = available_mmio; - remaining_mmio_pref = available_mmio_pref; + remaining_io = available_io = resource_size(&io); + remaining_mmio = available_mmio = resource_size(&mmio); + remaining_mmio_pref = available_mmio_pref = resource_size(&mmio_pref); for_each_pci_bridge(dev, bus) { const struct resource *res; |