projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e240edf
)
PCI: Refactor find_bus_resource_of_type() logic checks
author
Ilpo Järvinen
<ilpo.jarvinen@linux.intel.com>
Fri, 29 Aug 2025 13:10:54 +0000
(16:10 +0300)
committer
Bjorn Helgaas
<bhelgaas@google.com>
Tue, 16 Sep 2025 16:18:59 +0000
(11:18 -0500)
Reorder the logic checks in find_bus_resource_of_type() to simplify them.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link:
https://patch.msgid.link/20250829131113.36754-6-ilpo.jarvinen@linux.intel.com
drivers/pci/setup-bus.c
patch
|
blob
|
history
diff --git
a/drivers/pci/setup-bus.c
b/drivers/pci/setup-bus.c
index
4097d87
..
c5fc4e2
100644
(file)
--- a/
drivers/pci/setup-bus.c
+++ b/
drivers/pci/setup-bus.c
@@
-158,11
+158,15
@@
static struct resource *find_bus_resource_of_type(struct pci_bus *bus,
struct resource *r, *r_assigned = NULL;
pci_bus_for_each_resource(bus, r) {
- if (r == &ioport_resource || r == &iomem_resource)
+ if (
!r ||
r == &ioport_resource || r == &iomem_resource)
continue;
- if (r && (r->flags & type_mask) == type && !r->parent)
+
+ if ((r->flags & type_mask) != type)
+ continue;
+
+ if (!r->parent)
return r;
- if (
r && (r->flags & type_mask) == type &&
!r_assigned)
+ if (!r_assigned)
r_assigned = r;
}
return r_assigned;