Skip to contentSkip to conversation

powerpc: Fix build of 4xx simple platforms without CONFIG_PCI

PATCH In review Benjamin Herrenschmidt 3 participants 6 messages Dec 8, 2008 – Dec 10, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Fix build of 4xx simple platforms without CONFIG_PCI

The global ppc_pci_flags is not defined when CONFIG_PCI is not set, causing a link error

---

 arch/powerpc/platforms/40x/ppc40x_simple.c |    2 ++
 arch/powerpc/platforms/44x/ppc44x_simple.c |    2 ++
 2 files changed, 4 insertions(+)
arch/powerpc/platforms/40x/ppc40x_simple.c +2 -0
@@ -61,7 +61,9 @@ static int __init ppc40x_probe(void)
 
 	for (i = 0; i < ARRAY_SIZE(board); i++) {
 		if (of_flat_dt_is_compatible(root, board[i])) {
+#ifdef CONFIG_PCI
 			ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+#endif
 			return 1;
 		}
 	}
arch/powerpc/platforms/44x/ppc44x_simple.c +2 -0
Index: linux-work/arch/powerpc/platforms/44x/ppc44x_simple.c
===================================================================
@@ -70,7 +70,9 @@ static int __init ppc44x_probe(void)
 
 	for (i = 0; i < ARRAY_SIZE(board); i++) {
 		if (of_flat_dt_is_compatible(root, board[i])) {
+#ifdef CONFIG_PCI
 			ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+#endif
 			return 1;
 		}
 	}
#1 lore raw
Quoted 13 lines · Benjamin Herrenschmidt

The global ppc_pci_flags is not defined when CONFIG_PCI is not set, causing a link error

---

 arch/powerpc/platforms/40x/ppc40x_simple.c |    2 ++
 arch/powerpc/platforms/44x/ppc44x_simple.c |    2 ++
 2 files changed, 4 insertions(+)

arch/powerpc/platforms/40x/ppc40x_simple.c static int __init ppc40x_probe(void) · line 66

Quoted 6 lines
arch/powerpc/platforms/40x/ppc40x_simple.c +2 -0
@@ -61,7 +61,9 @@ static int __init ppc40x_probe(void)
 
 	for (i = 0; i < ARRAY_SIZE(board); i++) {
 		if (of_flat_dt_is_compatible(root, board[i])) {
+#ifdef CONFIG_PCI
 			ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+#endif

No! #ifdefs! in C code!

To the tune of you-know-what.

Looks like we need an accessor we can replace with an empty version in the !PCI case.

cheers

Signature · 8 lines
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
#2 lore raw
Quoted 13 lines

arch/powerpc/platforms/40x/ppc40x_simple.c static int __init ppc40x_probe(void) · line 66

Quoted 10 lines
arch/powerpc/platforms/40x/ppc40x_simple.c +2 -0
@@ -61,7 +61,9 @@ static int __init ppc40x_probe(void)
 
 	for (i = 0; i < ARRAY_SIZE(board); i++) {
 		if (of_flat_dt_is_compatible(root, board[i])) {
+#ifdef CONFIG_PCI
 			ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+#endif

No! #ifdefs! in C code!

Quoted 4 lines

To the tune of you-know-what.

Looks like we need an accessor we can replace with an empty version in the !PCI case.

If you have plenty of time on your hands :-) In the meantime, this is a build fix.

Cheers,
Ben.

#3 lore raw
Quoted 13 lines · On Mon, 08 Dec 2008 16:38:14 +1100 Benjamin Herrenschmidt…
Quoted 13 lines

arch/powerpc/platforms/40x/ppc40x_simple.c static int __init ppc40x_probe(void) · line 66

Quoted 10 lines
arch/powerpc/platforms/40x/ppc40x_simple.c +2 -0
@@ -61,7 +61,9 @@ static int __init ppc40x_probe(void)
 
 	for (i = 0; i < ARRAY_SIZE(board); i++) {
 		if (of_flat_dt_is_compatible(root, board[i])) {
+#ifdef CONFIG_PCI
 			ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+#endif

No! #ifdefs! in C code!

Quoted 7 lines
Quoted 4 lines

To the tune of you-know-what.

Looks like we need an accessor we can replace with an empty version in the !PCI case.

If you have plenty of time on your hands :-) In the meantime, this is a build fix.

I have time. I hate ifdefs.

josh

#4 lore raw
Quoted 18 lines · On Wed, 10 Dec 2008 09:25:08 -0500 Josh Boyer <[email protected]>…
Quoted 15 lines · On Mon, 08 Dec 2008 16:38:14 +1100 Benjamin Herrenschmidt…
Quoted 15 lines

arch/powerpc/platforms/40x/ppc40x_simple.c static int __init ppc40x_probe(void) · line 66

Quoted 10 lines
arch/powerpc/platforms/40x/ppc40x_simple.c +2 -0
@@ -61,7 +61,9 @@ static int __init ppc40x_probe(void)
 
 	for (i = 0; i < ARRAY_SIZE(board); i++) {
 		if (of_flat_dt_is_compatible(root, board[i])) {
+#ifdef CONFIG_PCI
 			ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+#endif

No! #ifdefs! in C code!

To the tune of you-know-what.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Looks like we need an accessor we can replace with an empty version in the !PCI case.

If you have plenty of time on your hands :-) In the meantime, this is a build fix.

I have time. I hate ifdefs.

Oh, and:
http://ozlabs.org/pipermail/linuxppc-dev/2007-December/048214.html

I told you so (sort of). Ha! ;)

josh

#5 lore raw
In reply to Josh Boyer
Quoted 16 lines · Josh Boyer
Quoted 14 lines · On Mon, 08 Dec 2008 16:38:14 +1100 Benjamin Herrenschmidt…
Quoted 14 lines

arch/powerpc/platforms/40x/ppc40x_simple.c static int __init ppc40x_probe(void) · line 66

Quoted 9 lines
arch/powerpc/platforms/40x/ppc40x_simple.c +2 -0
@@ -61,7 +61,9 @@ static int __init ppc40x_probe(void)
 
 	for (i = 0; i < ARRAY_SIZE(board); i++) {
 		if (of_flat_dt_is_compatible(root, board[i])) {
+#ifdef CONFIG_PCI
 			ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+#endif

No! #ifdefs! in C code!

To the tune of you-know-what.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Looks like we need an accessor we can replace with an empty version in the !PCI case.

If you have plenty of time on your hands :-) In the meantime, this is a build fix.

I have time. I hate ifdefs.

You are awesome.

Signature · 8 lines
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person