mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 17:03:47 -04:00
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>
This commit is contained in:
committed by
Bjorn Helgaas
parent
cbd384389e
commit
2bd0c72117
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user