Skip to contentSkip to conversation

Fix 2.6.13rc2 compilation without CONFIG_HOTPLUG

PATCH In review Andi Kleen 2 participants 2 messages Jul 6, 2005 – Jul 7, 2005 PCI

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 Fix 2.6.13rc2 compilation without CONFIG_HOTPLUG

Otherwise PCI won't compile.

drivers/pci/pci-driver.c +4 -0
Index: linux/drivers/pci/pci-driver.c
===================================================================
@@ -145,12 +145,15 @@ const struct pci_device_id *pci_match_de
 					     struct pci_dev *dev)
 {
 	const struct pci_device_id *id;
+#ifdef CONFIG_HOTPLUG  /* A kingdom for C99 */
 	struct pci_dynid *dynid;
+#endif
 
 	id = pci_match_id(drv->id_table, dev);
 	if (id)
 		return id;
 
+#ifdef CONFIG_HOTPLUG
 	/* static ids didn't match, lets look at the dynamic ones */
 	spin_lock(&drv->dynids.lock);
 	list_for_each_entry(dynid, &drv->dynids.list, node) {
@@ -160,6 +163,7 @@ const struct pci_device_id *pci_match_de
 		}
 	}
 	spin_unlock(&drv->dynids.lock);
+#endif
 	return NULL;
 }
 
#1 lore raw
Quoted 4 lines · Andi Kleen

Otherwise PCI won't compile.

No, I like this patch better, it's cleaner and is what I intended the code to be. I've already sent it to Linus and the list.

thanks,

greg k-h

---
 drivers/pci/pci-driver.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/pci/pci-driver.c +2 -2
@@ -17,13 +17,13 @@
  * Dynamic device IDs are disabled for !CONFIG_HOTPLUG
  */
 
-#ifdef CONFIG_HOTPLUG
-
 struct pci_dynid {
 	struct list_head node;
 	struct pci_device_id id;
 };
 
+#ifdef CONFIG_HOTPLUG
+
 /**
  * store_new_id
  *