Commit 451124a7 authored by Sam Ravnborg's avatar Sam Ravnborg Committed by Greg Kroah-Hartman

PCI: fix 4x section mismatch warnings

The following warnings were issued during build of
drivers/pci with an allyesconfig build:
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0xdaf): Section mismatch in reference from the function pci_add_new_bus() to the function .devinit.text:pci_alloc_child_bus()
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x15e2): Section mismatch in reference from the function pci_scan_single_device() to the function .devinit.text:pci_scan_device()
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x1b0c5): Section mismatch in reference from the function pci_bus_assign_resources() to the function .devinit.text:pci_setup_bridge()
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x1b32d): Section mismatch in reference from the function pci_bus_size_bridges() to the function .devinit.text:pci_bus_size_cardbus()

Investigating each case closer it looked like all
referred functions are only used in the init phase
or during hotplug.
So to avoid wasting too much memory in the non-hotplug
case the simpler fix was to allow the fuctions to
use code/data from the __devinit sections.
This was done in all four case by adding the __ref
annotation.
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Cc: Adrian Bunk <bunk@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4105717b
...@@ -433,7 +433,7 @@ pci_alloc_child_bus(struct pci_bus *parent, struct pci_dev *bridge, int busnr) ...@@ -433,7 +433,7 @@ pci_alloc_child_bus(struct pci_bus *parent, struct pci_dev *bridge, int busnr)
return child; return child;
} }
struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr) struct pci_bus *__ref pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr)
{ {
struct pci_bus *child; struct pci_bus *child;
...@@ -948,7 +948,7 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus) ...@@ -948,7 +948,7 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
up_write(&pci_bus_sem); up_write(&pci_bus_sem);
} }
struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn) struct pci_dev *__ref pci_scan_single_device(struct pci_bus *bus, int devfn)
{ {
struct pci_dev *dev; struct pci_dev *dev;
......
...@@ -456,7 +456,7 @@ pci_bus_size_cardbus(struct pci_bus *bus) ...@@ -456,7 +456,7 @@ pci_bus_size_cardbus(struct pci_bus *bus)
} }
} }
void pci_bus_size_bridges(struct pci_bus *bus) void __ref pci_bus_size_bridges(struct pci_bus *bus)
{ {
struct pci_dev *dev; struct pci_dev *dev;
unsigned long mask, prefmask; unsigned long mask, prefmask;
...@@ -511,7 +511,7 @@ void pci_bus_size_bridges(struct pci_bus *bus) ...@@ -511,7 +511,7 @@ void pci_bus_size_bridges(struct pci_bus *bus)
} }
EXPORT_SYMBOL(pci_bus_size_bridges); EXPORT_SYMBOL(pci_bus_size_bridges);
void pci_bus_assign_resources(struct pci_bus *bus) void __ref pci_bus_assign_resources(struct pci_bus *bus)
{ {
struct pci_bus *b; struct pci_bus *b;
struct pci_dev *dev; struct pci_dev *dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment