* [PATCH] x86: fix section mismatch in pci_scan_bus
@ 2008-04-29 20:38 Sam Ravnborg
2008-04-29 20:44 ` Jesse Barnes
0 siblings, 1 reply; 2+ messages in thread
From: Sam Ravnborg @ 2008-04-29 20:38 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin; +Cc: LKML, Jesse Barnes
Fix following section mismatch warning:
WARNING: vmlinux.o(.text+0x275616): Section mismatch in reference from the function pci_scan_bus() to the function .devinit.text:pci_scan_bus_parented()
The warning was seen with a CONFIG_DEBUG_SECTION_MISMATCH=y build.
The inline function pci_scan_bus refer to functions annotated
__devinit - so annotate it __devinit too.
This revealed a few x86 specific functions that were only
used from __init or __devinit context.
So annotate these __devinit and the warning was killed.
The added include in pci.h was not strictly required but
added to avoid being dependent on indirect includes.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 2a4d751..88b5416 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -489,7 +489,7 @@ void pcibios_disable_device (struct pci_dev *dev)
pcibios_disable_irq(dev);
}
-struct pci_bus *pci_scan_bus_on_node(int busno, struct pci_ops *ops, int node)
+struct pci_bus * __devinit pci_scan_bus_on_node(int busno, struct pci_ops *ops, int node)
{
struct pci_bus *bus = NULL;
struct pci_sysdata *sd;
@@ -512,7 +512,7 @@ struct pci_bus *pci_scan_bus_on_node(int busno, struct pci_ops *ops, int node)
return bus;
}
-struct pci_bus *pci_scan_bus_with_sysdata(int busno)
+struct pci_bus * __devinit pci_scan_bus_with_sysdata(int busno)
{
return pci_scan_bus_on_node(busno, &pci_root_ops, -1);
}
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 96acd0d..a59517b 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -44,6 +44,7 @@
#include <linux/mod_devicetable.h>
#include <linux/types.h>
+#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/list.h>
#include <linux/compiler.h>
@@ -474,7 +475,7 @@ extern struct pci_bus *pci_find_bus(int domain, int busnr);
void pci_bus_add_devices(struct pci_bus *bus);
struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus,
struct pci_ops *ops, void *sysdata);
-static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops,
+static inline struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops,
void *sysdata)
{
struct pci_bus *root_bus;
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] x86: fix section mismatch in pci_scan_bus
2008-04-29 20:38 [PATCH] x86: fix section mismatch in pci_scan_bus Sam Ravnborg
@ 2008-04-29 20:44 ` Jesse Barnes
0 siblings, 0 replies; 2+ messages in thread
From: Jesse Barnes @ 2008-04-29 20:44 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, LKML
On Tuesday, April 29, 2008 1:38 pm Sam Ravnborg wrote:
> Fix following section mismatch warning:
> WARNING: vmlinux.o(.text+0x275616): Section mismatch in reference from the
> function pci_scan_bus() to the function
> .devinit.text:pci_scan_bus_parented()
>
> The warning was seen with a CONFIG_DEBUG_SECTION_MISMATCH=y build.
> The inline function pci_scan_bus refer to functions annotated
> __devinit - so annotate it __devinit too.
> This revealed a few x86 specific functions that were only
> used from __init or __devinit context.
> So annotate these __devinit and the warning was killed.
>
> The added include in pci.h was not strictly required but
> added to avoid being dependent on indirect includes.
>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Applied, thanks Sam.
Jesse
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-29 20:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-29 20:38 [PATCH] x86: fix section mismatch in pci_scan_bus Sam Ravnborg
2008-04-29 20:44 ` Jesse Barnes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®