linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* move pci_domain_nr() inside "#ifdef CONFIG_PCI" bracket
@ 2003-06-18 21:10 David Mosberger
  2003-06-18 21:57 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: David Mosberger @ 2003-06-18 21:10 UTC (permalink / raw)
  To: torvalds; +Cc: willy, linux-kernel

Trivial build fix: pci_domain_nr() cannot be declared unless
CONFIG_PCI is defined (otherwise, struct pci_bus hasn't been defined).

	--david

diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	Wed Jun 18 13:32:49 2003
+++ b/include/linux/pci.h	Wed Jun 18 13:32:49 2003
@@ -743,6 +743,15 @@
 	return rc;
 }
 
+/*
+ * PCI domain support.  Sometimes called PCI segment (eg by ACPI),
+ * a PCI domain is defined to be a set of PCI busses which share
+ * configuration space.
+ */
+#ifndef CONFIG_PCI_DOMAINS
+static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
+#endif
+
 #endif /* !CONFIG_PCI */
 
 /* these helpers provide future and backwards compatibility
@@ -799,16 +808,6 @@
 #define PCIPCI_VIAETBF		8
 #define PCIPCI_VSFX		16
 #define PCIPCI_ALIMAGIK		32
-
-/*
- * PCI domain support.  Sometimes called PCI segment (eg by ACPI),
- * a PCI domain is defined to be a set of PCI busses which share
- * configuration space.
- */
-
-#ifndef CONFIG_PCI_DOMAINS
-static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
-#endif
 
 #endif /* __KERNEL__ */
 #endif /* LINUX_PCI_H */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: move pci_domain_nr() inside "#ifdef CONFIG_PCI" bracket
  2003-06-18 21:10 move pci_domain_nr() inside "#ifdef CONFIG_PCI" bracket David Mosberger
@ 2003-06-18 21:57 ` Greg KH
  2003-06-19 15:03   ` Matthew Wilcox
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2003-06-18 21:57 UTC (permalink / raw)
  To: davidm; +Cc: torvalds, willy, linux-kernel

On Wed, Jun 18, 2003 at 02:10:04PM -0700, David Mosberger wrote:
> Trivial build fix: pci_domain_nr() cannot be declared unless
> CONFIG_PCI is defined (otherwise, struct pci_bus hasn't been defined).

Thanks, I've added this to my pci bk tree and will send it off to Linus
in a bit.

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: move pci_domain_nr() inside "#ifdef CONFIG_PCI" bracket
  2003-06-18 21:57 ` Greg KH
@ 2003-06-19 15:03   ` Matthew Wilcox
  2003-06-19 16:19     ` Matthew Wilcox
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Wilcox @ 2003-06-19 15:03 UTC (permalink / raw)
  To: Greg KH; +Cc: davidm, torvalds, willy, linux-kernel

On Wed, Jun 18, 2003 at 02:57:06PM -0700, Greg KH wrote:
> On Wed, Jun 18, 2003 at 02:10:04PM -0700, David Mosberger wrote:
> > Trivial build fix: pci_domain_nr() cannot be declared unless
> > CONFIG_PCI is defined (otherwise, struct pci_bus hasn't been defined).
> 
> Thanks, I've added this to my pci bk tree and will send it off to Linus
> in a bit.

I don't understand.  One of the PPC guys saw it too, but how is it
possible?  CONFIG_PCI is first mentioned at line 526 of pci.h.
pci_bus is defined at line 446.

-- 
It's always legal to use Linux (TM) systems
http://www.gnu.org/philosophy/why-free.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: move pci_domain_nr() inside "#ifdef CONFIG_PCI" bracket
  2003-06-19 15:03   ` Matthew Wilcox
@ 2003-06-19 16:19     ` Matthew Wilcox
  2003-06-19 17:04       ` Ivan Kokshaysky
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Wilcox @ 2003-06-19 16:19 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Greg KH, davidm, torvalds, linux-kernel

On Thu, Jun 19, 2003 at 09:03:44AM -0600, Matthew Wilcox wrote:
> On Wed, Jun 18, 2003 at 02:57:06PM -0700, Greg KH wrote:
> > On Wed, Jun 18, 2003 at 02:10:04PM -0700, David Mosberger wrote:
> > > Trivial build fix: pci_domain_nr() cannot be declared unless
> > > CONFIG_PCI is defined (otherwise, struct pci_bus hasn't been defined).
> > 
> > Thanks, I've added this to my pci bk tree and will send it off to Linus
> > in a bit.
> 
> I don't understand.  One of the PPC guys saw it too, but how is it
> possible?  CONFIG_PCI is first mentioned at line 526 of pci.h.
> pci_bus is defined at line 446.

Now I understand.  Tom Rini forwarded me the output from gcc -E.  The
problem is that CONFIG_PCI_DOMAIN is conditional on CONFIG_PCI.  So ppc
& ia64 define a macro for pci_domain_nr, then PCI_DOMAIN isn't set, so
the default definition of pci_domain_nr happens ... and gets mutilated
by the macro:

static inline int ((struct pci_controller *)( struct pci_bus *bus)->sysdata)->index  { return 0; }

A bit subtle, that ... I think this patch is fine, though perhaps it'd
be best to unconditionally make CONFIG_PCI_DOMAIN true as well?

-- 
It's always legal to use Linux (TM) systems
http://www.gnu.org/philosophy/why-free.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: move pci_domain_nr() inside "#ifdef CONFIG_PCI" bracket
  2003-06-19 16:19     ` Matthew Wilcox
@ 2003-06-19 17:04       ` Ivan Kokshaysky
  0 siblings, 0 replies; 5+ messages in thread
From: Ivan Kokshaysky @ 2003-06-19 17:04 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Greg KH, davidm, torvalds, linux-kernel

On Thu, Jun 19, 2003 at 10:19:52AM -0600, Matthew Wilcox wrote:
> A bit subtle, that ... I think this patch is fine, though perhaps it'd
> be best to unconditionally make CONFIG_PCI_DOMAIN true as well?

That's that I did on alpha.

Ivan.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-06-19 16:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-18 21:10 move pci_domain_nr() inside "#ifdef CONFIG_PCI" bracket David Mosberger
2003-06-18 21:57 ` Greg KH
2003-06-19 15:03   ` Matthew Wilcox
2003-06-19 16:19     ` Matthew Wilcox
2003-06-19 17:04       ` Ivan Kokshaysky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).