Skip to contentSkip to conversation

Missing ifndef __ASSEMBLY__ in include/asm-powerpc/dcr.h

PATCH In review Mathieu Desnoyers 3 participants 4 messages Feb 5, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Missing ifndef __ASSEMBLY__ in include/asm-powerpc/dcr.h

Missing ifndef __ASSEMBLY__ in include/asm-powerpc/dcr.h

A missing structure forward declaration causes a lot of warnings when compiling for a powerpc 405. Because this header is used for assembly too, the declaration must be put within #ifndef __ASSEMBLY__, as should be the function prototypes.

This patch applies on 2.6.20.

include/asm-powerpc/dcr.h +3 -0
@@ -33,10 +33,13 @@
  * base from the device-tree
  */
 #ifdef CONFIG_PPC_MERGE
+#ifndef __ASSEMBLY__
+struct device_node;
 extern unsigned int dcr_resource_start(struct device_node *np,
 				       unsigned int index);
 extern unsigned int dcr_resource_len(struct device_node *np,
 				     unsigned int index);
+#endif
 #endif /* CONFIG_PPC_MERGE */

=20
#endif /* CONFIG_PPC_DCR */
--=20
Mathieu Desnoyers
Computer Engineering Graduate Student, =C9cole Polytechnique de Montr=E9al OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68

#1 lore raw
Quoted 10 lines · Mathieu Desnoyers

Missing ifndef __ASSEMBLY__ in include/asm-powerpc/dcr.h

A missing structure forward declaration causes a lot of warnings when compiling for a powerpc 405. Because this header is used for assembly too, the declaration must be put within #ifndef __ASSEMBLY__, as should be the function prototypes.

This patch applies on 2.6.20.

Out of curiosity, are you working on 405 support for arch/powerpc ?

Ben.

Quoted 16 lines
include/asm-powerpc/dcr.h +3 -0
@@ -33,10 +33,13 @@
  * base from the device-tree
  */
 #ifdef CONFIG_PPC_MERGE
+#ifndef __ASSEMBLY__
+struct device_node;
 extern unsigned int dcr_resource_start(struct device_node *np,
 				       unsigned int index);
 extern unsigned int dcr_resource_len(struct device_node *np,
 				     unsigned int index);
+#endif
 #endif /* CONFIG_PPC_MERGE */
 
 #endif /* CONFIG_PPC_DCR */
#2 lore raw
Quoted 11 lines · * Benjamin Herrenschmidt ([email protected]) wrote:
Quoted 10 lines · Mathieu Desnoyers

Missing ifndef __ASSEMBLY__ in include/asm-powerpc/dcr.h
=20
A missing structure forward declaration causes a lot of warnings when compiling for a powerpc 405. Because this header is used for assembly too, the declaration must be put within #ifndef __ASSEMBLY__, as should be the function prototypes.
=20
This patch applies on 2.6.20.
=20

Quoted 5 lines

=20
Out of curiosity, are you working on 405 support for arch/powerpc ? =20
Ben.
=20

I am just trying to compile for my LTTng tracer regression tests. I guess I'm better off using arch/pcc instead.

Quoted 9 lines
Quoted 9 lines
include/asm-powerpc/dcr.h +2 -0
@@ -33,10 +33,13 @@
  * base from the device-tree
  */
 #ifdef CONFIG_PPC_MERGE
+#ifndef __ASSEMBLY__
+struct device_node;
 extern unsigned int dcr_resource_start(struct device_node *np,
Quoted 8 lines
Quoted 7 lines
include/asm-powerpc/dcr.h +1 -0
 				       unsigned int index);
 extern unsigned int dcr_resource_len(struct device_node *np,
 				     unsigned int index);
+#endif
 #endif /* CONFIG_PPC_MERGE */

=20
#endif /* CONFIG_PPC_DCR */

=20

--=20
Mathieu Desnoyers
Computer Engineering Graduate Student, =C9cole Polytechnique de Montr=E9al OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68

#3 lore raw
In reply to Mathieu Desnoyers
Quoted 8 lines · Mathieu Desnoyers

Missing ifndef __ASSEMBLY__ in include/asm-powerpc/dcr.h

A missing structure forward declaration causes a lot of warnings when compiling for a powerpc 405. Because this header is used for assembly too, the declaration must be put within #ifndef __ASSEMBLY__, as should be the function prototypes.

This patch applies on 2.6.20.

This is the wrong fix. The arch/powerpc version of dcr.h, unlike the arch/ppc version, should never be included in assembler.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson