* [PATCH 2.6.13-rc2] pci: fix PCI && !HOTPLUG compile error
@ 2005-07-06 15:02 Mikael Pettersson
2005-07-06 16:11 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Mikael Pettersson @ 2005-07-06 15:02 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel
2.6.13-rc2 triggers compile errors in pci-driver.c
when hotplug is disabled:
drivers/pci/pci-driver.c: In function 'pci_match_device':
drivers/pci/pci-driver.c:156: error: dereferencing pointer to incomplete type
drivers/pci/pci-driver.c:156: warning: type defaults to 'int' in declaration of 'type name'
drivers/pci/pci-driver.c:156: error: request for member 'node' in something not a structure or union
drivers/pci/pci-driver.c:156: warning: type defaults to 'int' in declaration of '__mptr'
drivers/pci/pci-driver.c:156: warning: initialization from incompatible pointer type
etc
This is because 2.6.13-rc2 added a code block to this function which references
hotplug-only stuff. Fixed crudely by #ifdef CONFIG_HOTPLUG around it.
Signed-off-by: Mikael Pettersson <mikpe@csd.uu.se>
--- linux-2.6.13-rc2/drivers/pci/pci-driver.c.~1~ 2005-07-06 15:20:41.000000000 +0200
+++ linux-2.6.13-rc2/drivers/pci/pci-driver.c 2005-07-06 15:49:18.000000000 +0200
@@ -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
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;
}
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH 2.6.13-rc2] pci: fix PCI && !HOTPLUG compile error
2005-07-06 15:02 [PATCH 2.6.13-rc2] pci: fix PCI && !HOTPLUG compile error Mikael Pettersson
@ 2005-07-06 16:11 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2005-07-06 16:11 UTC (permalink / raw)
To: Mikael Pettersson; +Cc: linux-kernel
On Wed, Jul 06, 2005 at 05:02:41PM +0200, Mikael Pettersson wrote:
> 2.6.13-rc2 triggers compile errors in pci-driver.c
> when hotplug is disabled:
>
> drivers/pci/pci-driver.c: In function 'pci_match_device':
> drivers/pci/pci-driver.c:156: error: dereferencing pointer to incomplete type
> drivers/pci/pci-driver.c:156: warning: type defaults to 'int' in declaration of 'type name'
> drivers/pci/pci-driver.c:156: error: request for member 'node' in something not a structure or union
> drivers/pci/pci-driver.c:156: warning: type defaults to 'int' in declaration of '__mptr'
> drivers/pci/pci-driver.c:156: warning: initialization from incompatible pointer type
> etc
>
> This is because 2.6.13-rc2 added a code block to this function which references
> hotplug-only stuff. Fixed crudely by #ifdef CONFIG_HOTPLUG around it.
No, use this patch instead, it's smaller and cleaner, and is what I ment
the code to look like in the first place :)
thanks,
greg k-h
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/pci/pci-driver.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
--- gregkh-2.6.orig/drivers/pci/pci-driver.c 2005-07-06 01:03:26.000000000 -0700
+++ gregkh-2.6/drivers/pci/pci-driver.c 2005-07-06 09:07:09.000000000 -0700
@@ -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
*
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-07-07 2:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-06 15:02 [PATCH 2.6.13-rc2] pci: fix PCI && !HOTPLUG compile error Mikael Pettersson
2005-07-06 16:11 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox