diff options
author | 2024-12-16 19:56:16 +0200 | |
---|---|---|
committer | 2025-02-18 15:40:53 -0600 | |
commit | 2bd0c72117841f7fb82aab7f4a0d65e66ef9543e (patch) | |
tree | 176e8855f5c86b6412b53e6992aa4f3663f66533 /drivers/pci/setup-bus.c | |
parent | PCI: Add pci_resource_is_iov() to identify IOV resources (diff) | |
download | wireguard-linux-2bd0c72117841f7fb82aab7f4a0d65e66ef9543e.tar.xz wireguard-linux-2bd0c72117841f7fb82aab7f4a0d65e66ef9543e.zip |
PCI: Check resource_size() separately
Instead of chaining logic inside if () condition so that multiple lines are
required, make !resource_size() a separate check and use continue.
Link: https://lore.kernel.org/r/20241216175632.4175-10-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Xiaochun Lee <lixc17@lenovo.com>
Diffstat (limited to 'drivers/pci/setup-bus.c')
-rw-r--r-- | drivers/pci/setup-bus.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 5f3215e0904d..eaeaf09cd91d 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -285,8 +285,11 @@ static void assign_requested_resources_sorted(struct list_head *head, list_for_each_entry(dev_res, head, list) { res = dev_res->res; idx = res - &dev_res->dev->resource[0]; - if (resource_size(res) && - pci_assign_resource(dev_res->dev, idx)) { + + if (!resource_size(res)) + continue; + + if (pci_assign_resource(dev_res->dev, idx)) { if (fail_head) { /* * If the failed resource is a ROM BAR and |