public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Sam Ravnborg <sam@ravnborg.org>, Greg KH <gregkh@suse.de>,
	Adrian Bunk <bunk@kernel.org>
Subject: [PATCH] pci: fix section mismatch warnings referring to pci_do_scan_bus
Date: Thu, 31 Jan 2008 23:10:30 +0100	[thread overview]
Message-ID: <1201817440-5081-1-git-send-email-sam@ravnborg.org> (raw)
In-Reply-To: <20080131220430.GA4874@uranus.ravnborg.org>

Fix following warnings:
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0xb054): Section mismatch in reference from the function cpci_configure_slot() to the function .devinit.text:pci_do_scan_bus()
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x153ab): Section mismatch in reference from the function shpchp_configure_device() to the function .devinit.text:pci_do_scan_bus()
WARNING: o-x86_64/drivers/pci/built-in.o(__ksymtab+0xc0): Section mismatch in reference from the variable __ksymtab_pci_do_scan_bus to the function .devinit.text:pci_do_scan_bus()

PCI hotplug were the only user of pci_do_scan_bus()
so moving this function to the directory of
PCI Hotplug was a logical way to fix so
we only include this function in the kernel
when the CONFIG_HOTPLUG_PCI is enabled.

Then the abuse of __devinit could be dropped and
we no longer trigger the above warnings.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Greg KH <gregkh@suse.de>
Cc: Adrian Bunk <bunk@kernel.org>
---
 drivers/pci/hotplug/Makefile   |    1 +
 drivers/pci/hotplug/pci-core.c |   20 ++++++++++++++++++++
 drivers/pci/probe.c            |   15 ---------------
 3 files changed, 21 insertions(+), 15 deletions(-)
 create mode 100644 drivers/pci/hotplug/pci-core.c

diff --git a/drivers/pci/hotplug/Makefile b/drivers/pci/hotplug/Makefile
index 34a1891..f755a6e 100644
--- a/drivers/pci/hotplug/Makefile
+++ b/drivers/pci/hotplug/Makefile
@@ -1,6 +1,7 @@
 #
 # Makefile for the Linux kernel pci hotplug controller drivers.
 #
+obj-y := pci-core.o
 
 obj-$(CONFIG_HOTPLUG_PCI)		+= pci_hotplug.o
 obj-$(CONFIG_HOTPLUG_PCI_FAKE)		+= fakephp.o 
diff --git a/drivers/pci/hotplug/pci-core.c b/drivers/pci/hotplug/pci-core.c
new file mode 100644
index 0000000..e0fb169
--- /dev/null
+++ b/drivers/pci/hotplug/pci-core.c
@@ -0,0 +1,20 @@
+/* Core PCI functionality used only by PCI hotplug */
+
+#include <linux/pci.h>
+#include "../pci.h"
+
+
+unsigned int pci_do_scan_bus(struct pci_bus *bus)
+{
+	unsigned int max;
+
+	max = pci_scan_child_bus(bus);
+
+	/*
+	 * Make the discovered devices available.
+	 */
+	pci_bus_add_devices(bus);
+
+	return max;
+}
+EXPORT_SYMBOL(pci_do_scan_bus);
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 5fd5852..496fc13 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1050,20 +1050,6 @@ unsigned int pci_scan_child_bus(struct pci_bus *bus)
 	return max;
 }
 
-unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus)
-{
-	unsigned int max;
-
-	max = pci_scan_child_bus(bus);
-
-	/*
-	 * Make the discovered devices available.
-	 */
-	pci_bus_add_devices(bus);
-
-	return max;
-}
-
 struct pci_bus * pci_create_bus(struct device *parent,
 		int bus, struct pci_ops *ops, void *sysdata)
 {
@@ -1156,7 +1142,6 @@ EXPORT_SYMBOL(pci_scan_bus_parented);
 
 #ifdef CONFIG_HOTPLUG
 EXPORT_SYMBOL(pci_add_new_bus);
-EXPORT_SYMBOL(pci_do_scan_bus);
 EXPORT_SYMBOL(pci_scan_slot);
 EXPORT_SYMBOL(pci_scan_bridge);
 EXPORT_SYMBOL(pci_scan_single_device);
-- 
1.5.4.rc3.14.g44397


  reply	other threads:[~2008-01-31 22:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-31 22:04 [PATCH 0/11] fix 25 section mismatch warnings Sam Ravnborg
2008-01-31 22:10 ` Sam Ravnborg [this message]
2008-02-02 10:26   ` [PATCH] pci: fix section mismatch warnings referring to pci_do_scan_bus Sam Ravnborg
2008-01-31 22:10 ` [PATCH] pci: fix 4x section mismatch warnings Sam Ravnborg
2008-01-31 22:10 ` [PATCH] cpu: fix section mismatch warnings for enable_nonboot_cpus Sam Ravnborg
2008-01-31 22:10 ` [PATCH] cpu: fix section mismatch related to cpu_chain Sam Ravnborg
2008-01-31 22:10 ` [PATCH] cpu: do not annotate exported register_cpu_notifier() Sam Ravnborg
2008-01-31 22:10 ` [PATCH] cpu: silence section mismatch warnings for hotcpu notifies Sam Ravnborg
2008-01-31 22:10 ` [PATCH] mm: fix section mismatch warning in sparse.c Sam Ravnborg
2008-01-31 22:10 ` [PATCH] x86: fix section mismatch warning in acpi/boot.c Sam Ravnborg
2008-01-31 22:10 ` [PATCH] x86: silence section mismatch warning in smpboot_64.c Sam Ravnborg
2008-01-31 22:10 ` [PATCH] x86: fix section mismatch warning in kernel/pci-calgary Sam Ravnborg
2008-01-31 22:10 ` [PATCH] x86: fix section mismatch warnings when referencing notifiers Sam Ravnborg
2008-01-31 22:39 ` [PATCH 0/11] fix 25 section mismatch warnings Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1201817440-5081-1-git-send-email-sam@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=akpm@linux-foundation.org \
    --cc=bunk@kernel.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox