Patchwork [v4,13/29] PCI: Use for_each_pci_resource() in pci_reassigndev

login
register
mail settings
Submitter Yinghai Lu
Date April 12, 2013, 10:44 p.m.
Message ID <1365806683-26717-14-git-send-email-yinghai@kernel.org>
Download mbox | patch
Permalink /patch/236276/
State Rejected
Headers show

Comments

Yinghai Lu - April 12, 2013, 10:44 p.m.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 drivers/pci/pci.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index c29f062..d6203e9 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3782,7 +3782,7 @@  void pci_reassigndev_resource_alignment(struct pci_dev *dev)
 	command &= ~PCI_COMMAND_MEMORY;
 	pci_write_config_word(dev, PCI_COMMAND, command);
 
-	for (i = 0; i < PCI_BRIDGE_RESOURCES; i++) {
+	for_each_pci_resource(dev, r, i, PCI_STD_ROM_IOV_RES) {
 		r = &dev->resource[i];
 		if (!(r->flags & IORESOURCE_MEM))
 			continue;
@@ -3802,8 +3802,7 @@  void pci_reassigndev_resource_alignment(struct pci_dev *dev)
 	 */
 	if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE &&
 	    (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
-		for (i = PCI_BRIDGE_RESOURCES; i < PCI_NUM_RESOURCES; i++) {
-			r = &dev->resource[i];
+		for_each_pci_resource(dev, r, i, PCI_BRIDGE_RES) {
 			if (!(r->flags & IORESOURCE_MEM))
 				continue;
 			r->end = resource_size(r) - 1;