All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Alex Goddard <agoddard@purdue.edu>
Cc: Florin Iucha <florin@iucha.net>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Linux 2.5.73
Date: Sun, 22 Jun 2003 19:52:07 -0700	[thread overview]
Message-ID: <20030623025206.GA5891@kroah.com> (raw)
In-Reply-To: <Pine.LNX.4.56.0306221651470.16614@dust.p68.rivermarket.wintek.com>

On Sun, Jun 22, 2003 at 04:58:19PM -0500, Alex Goddard wrote:
> On Sun, 22 Jun 2003, Alex Goddard wrote:
> 
> > On Sun, 22 Jun 2003, Florin Iucha wrote:
> > 
> > > drivers/built-in.o(.text+0x3106): In function `pci_remove_bus_device':
> > > : undefined reference to `pci_destroy_dev'
> > > 
> > > pci_destroy_dev is defined under CONFIG_HOTPLUG and used outside.
> > > 
> > > florin
> > > 
> > > PS: I think changeset referenced in 10560659712069@kroah.com
> > > causes the problem.
> > 
> > An attempt at a fix.  It just moves pci_desroy_dev outside the #ifdef).  
> > I have no idea if this is the correct way to fix this.  It compiles okay.
> 
> Ack.  Dumb-assed mistake in that one.  This one shouldn't die during
> compile if CONFIG_HOTPLUG is turned on.  The other one defined 
> pci_destroy_dev() twice because I'm dumb.
> 
> It does compile (with and without hotplug) and boot.

Nah, the following patch from Ivan Kokshaysky is the better way to do
this.  I'll send it off to Linus on Monday.

thanks,

greg k-h


# [PATCH] PCI: fix non-hotplug build

Current BK won't build when CONFIG_HOTPLUG is not set due to
undefined references to pci_destroy_dev in hotplug.c.
I think it makes sense to not compile hotplug.c in this case at all.
Also, this allows to get rid of several function which are unused
in non-hotplug kernel.

Tested on Alpha.

diff -Nru a/drivers/pci/Makefile b/drivers/pci/Makefile
--- a/drivers/pci/Makefile	Sun Jun 22 19:48:43 2003
+++ b/drivers/pci/Makefile	Sun Jun 22 19:48:43 2003
@@ -3,14 +3,15 @@
 #
 
 obj-y		+= access.o bus.o probe.o pci.o pool.o quirks.o \
-			names.o pci-driver.o search.o hotplug.o \
-			pci-sysfs.o
+			names.o pci-driver.o search.o pci-sysfs.o
 obj-$(CONFIG_PM)  += power.o
 obj-$(CONFIG_PROC_FS) += proc.o
 
 ifndef CONFIG_SPARC64
 obj-$(CONFIG_PCI) += setup-res.o
 endif
+
+obj-$(CONFIG_HOTPLUG) += hotplug.o
 
 # Build the PCI Hotplug drivers if we were asked to
 obj-$(CONFIG_HOTPLUG_PCI) += hotplug/
diff -Nru a/drivers/pci/hotplug.c b/drivers/pci/hotplug.c
--- a/drivers/pci/hotplug.c	Sun Jun 22 19:48:43 2003
+++ b/drivers/pci/hotplug.c	Sun Jun 22 19:48:43 2003
@@ -12,7 +12,6 @@
 
 static void pci_free_resources(struct pci_dev *dev);
 
-#ifdef CONFIG_HOTPLUG
 int pci_hotplug (struct device *dev, char **envp, int num_envp,
 		 char *buffer, int buffer_size)
 {
@@ -209,16 +208,6 @@
 }
 EXPORT_SYMBOL(pci_remove_device_safe);
 
-#else /* CONFIG_HOTPLUG */
-
-int pci_hotplug (struct device *dev, char **envp, int num_envp,
-		 char *buffer, int buffer_size)
-{
-	return -ENODEV;
-}
-
-#endif /* CONFIG_HOTPLUG */
-
 static void
 pci_free_resources(struct pci_dev *dev)
 {
@@ -283,7 +272,5 @@
 	}
 }
 
-#ifdef CONFIG_HOTPLUG
 EXPORT_SYMBOL(pci_remove_bus_device);
 EXPORT_SYMBOL(pci_remove_behind_bridge);
-#endif
diff -Nru a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
--- a/drivers/pci/pci-driver.c	Sun Jun 22 19:48:43 2003
+++ b/drivers/pci/pci-driver.c	Sun Jun 22 19:48:43 2003
@@ -486,6 +486,14 @@
 		put_device(&dev->dev);
 }
 
+#ifndef CONFIG_HOTPLUG
+int pci_hotplug (struct device *dev, char **envp, int num_envp,
+		 char *buffer, int buffer_size)
+{
+	return -ENODEV;
+}
+#endif
+
 struct bus_type pci_bus_type = {
 	.name		= "pci",
 	.match		= pci_bus_match,

  reply	other threads:[~2003-06-23  2:38 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-22 18:53 Linux 2.5.73 Linus Torvalds
2003-06-22 20:06 ` Alex Goddard
2003-06-22 20:15   ` Andrew Morton
2003-06-22 22:53     ` Greg KH
2003-06-22 23:31       ` Andrew Morton
2003-06-22 20:46 ` Florin Iucha
2003-06-22 21:17   ` Alex Goddard
2003-06-22 21:45     ` Alex Goddard
2003-06-22 21:58     ` Alex Goddard
2003-06-23  2:52       ` Greg KH [this message]
2003-06-22 23:44 ` 2.5.73: ALSA ISA pnp_init_resource_table compile errors Adrian Bunk
2003-06-23  0:08   ` Adam Belay
2003-07-03  2:53     ` Adrian Bunk
2003-07-03 19:03       ` Adam Belay
2003-07-04 12:11         ` Adrian Bunk
2003-07-15 22:47           ` Adam Belay
2003-07-16 18:22             ` Adrian Bunk
2003-07-16 18:43               ` Adam Belay
2003-07-19 22:03                 ` Adrian Bunk
2003-07-20  5:59                 ` Jochen Hein
2003-08-09 20:40                 ` Adrian Bunk
2003-06-23  0:31 ` 2.5.73: acorn.c compile error Adrian Bunk
2003-06-23 10:13 ` Linux 2.5.73 - Won't compile using oldconfig - config attached vlad
2003-07-02 14:31   ` John Covici
2003-07-02 16:38     ` Greg KH
2003-06-23 20:32 ` Linux 2.5.73 - keyboard failure, repost no. 3 Terje Fåberg
2003-06-26 20:45   ` Vojtech Pavlik
2003-06-27 14:22     ` Terje Fåberg
2003-06-27 19:03       ` Vojtech Pavlik
2003-06-28  9:11         ` Terje Fåberg
2003-06-28  9:37           ` Vojtech Pavlik
2003-06-28 11:40             ` Terje Fåberg

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=20030623025206.GA5891@kroah.com \
    --to=greg@kroah.com \
    --cc=agoddard@purdue.edu \
    --cc=florin@iucha.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.