Skip to contentSkip to conversation

PCI: cpcihp: missing curly braces in cpci_configure_slot()

PATCH In review Dan Carpenter 3 participants 3 messages Feb 25, 2015 – Mar 6, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: cpcihp: missing curly braces in cpci_configure_slot()

I don't have this hardware but it looks like we weren't adding bridge devices as intended. Maybe the bridge is always the last device?

Fixes 05b125004815 ('PCI: cpcihp: Iterate over all devices in slot, not functions 0-7')
drivers/pci/hotplug/cpci_hotplug_pci.c +2 -1
index 7d48eca..788db48 100644
@@ -286,11 +286,12 @@ int cpci_configure_slot(struct slot *slot)
 	}
 	parent = slot->dev->bus;
 
-	list_for_each_entry(dev, &parent->devices, bus_list)
+	list_for_each_entry(dev, &parent->devices, bus_list) {
 		if (PCI_SLOT(dev->devfn) != PCI_SLOT(slot->devfn))
 			continue;
 		if (pci_is_bridge(dev))
 			pci_hp_add_bridge(dev);
+	}
 
 
 	pci_assign_unassigned_bridge_resources(parent->self);
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Dan Carpenter

I don't have this hardware but it looks like we weren't adding bridge devices as intended. Maybe the bridge is always the last device?

Fixes 05b125004815 ('PCI: cpcihp: Iterate over all devices in slot, not functions 0-7')
drivers/pci/hotplug/cpci_hotplug_pci.c +0 -0
index 7d48eca..788db48 100644
@@ -286,11 +286,12 @@ int cpci_configure_slot(struct slot *slot)
 	}

drivers/pci/hotplug/cpci_hotplug_pci.c int cpci_configure_slot(struct slot *slot) · line 295

Quoted 10 lines
drivers/pci/hotplug/cpci_hotplug_pci.c +2 -1
 	parent = slot->dev->bus;
 
-	list_for_each_entry(dev, &parent->devices, bus_list)
+	list_for_each_entry(dev, &parent->devices, bus_list) {
 		if (PCI_SLOT(dev->devfn) != PCI_SLOT(slot->devfn))
 			continue;
 		if (pci_is_bridge(dev))
 			pci_hp_add_bridge(dev);
+	}
 

Good fix.

Thanks!
Yijing.

Quoted 4 lines
drivers/pci/hotplug/cpci_hotplug_pci.c +0 -0
 	pci_assign_unassigned_bridge_resources(parent->self);
 
Signature · 2 lines
Thanks!
Yijing
maintainer
#2 lore raw
In reply to Dan Carpenter
Quoted 5 lines · Dan Carpenter

I don't have this hardware but it looks like we weren't adding bridge devices as intended. Maybe the bridge is always the last device?

Fixes 05b125004815 ('PCI: cpcihp: Iterate over all devices in slot, not functions 0-7')

Applied with Yijing's ack to for-linus for v4.0, thanks! Also marked for stable.

I'm afraid this is probably my fault, sorry.

Quoted 18 lines
drivers/pci/hotplug/cpci_hotplug_pci.c +2 -1
index 7d48eca..788db48 100644
@@ -286,11 +286,12 @@ int cpci_configure_slot(struct slot *slot)
 	}
 	parent = slot->dev->bus;
 
-	list_for_each_entry(dev, &parent->devices, bus_list)
+	list_for_each_entry(dev, &parent->devices, bus_list) {
 		if (PCI_SLOT(dev->devfn) != PCI_SLOT(slot->devfn))
 			continue;
 		if (pci_is_bridge(dev))
 			pci_hp_add_bridge(dev);
+	}
 
 
 	pci_assign_unassigned_bridge_resources(parent->self);