Skip to contentSkip to conversation

linux-next build error (at91) - use of bool in mach/arch.h

PATCH In review Nicolas Ferre 4 participants 8 messages Apr 30, 2013 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

Hi,

Today I discovered an issue while building linux-next for at91:

CC arch/arm/mach-at91/at91sam9260_devices.o
In file included from /home/nferre/dev/lnx_buid_test/arch/arm/mach-at91/at91sam9260_devices.c:12:0:
/home/nferre/dev/lnx_buid_test/arch/arm/include/asm/mach/arch.h:46:2: error: expected specifier-qualifier-list before ‘bool’

It also applies to all non-DT at91 platforms (~ 6 machines).

It seems to be caused by inclusion of commmit 4dbfa9a25367cfa91aec0e56d75a6905d3242cd3 (ARM: Enable selection of SMP operations at boot time) and its use of the "bool" type.

In fact, we include asm/mach/arch.h file in our at91xxx_devices.c files and we include it as the first include directive.

So, I am wondering if the best correction is to add the types.h header file in the asm/mach/arch.h file, like this:

arch/arm/include/asm/mach/arch.h +2 -0
@@ -8,6 +8,8 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/types.h>
+
 #ifndef __ASSEMBLY__
 
 struct tag;

or if a better option would be to re-arrange the include directives in various at91xxx_devices.c files?

Thanks, bye,

Signature · 1 line
Nicolas Ferre
#1 lore raw
Quoted 15 lines · Nicolas Ferre

So, I am wondering if the best correction is to add the types.h header file in the asm/mach/arch.h file, like this:

arch/arm/include/asm/mach/arch.h +2 -0
@@ -8,6 +8,8 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/types.h>
+
 #ifndef __ASSEMBLY__
 
 struct tag;
Quoted 2 lines

or if a better option would be to re-arrange the include directives in various at91xxx_devices.c files?

Include files should be self-contained, so asm/mach/arch.h is the right place.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#2 lore raw
Quoted 14 lines · Geert Uytterhoeven
Quoted 13 lines · Nicolas Ferre

So, I am wondering if the best correction is to add the types.h header file in the asm/mach/arch.h file, like this:

arch/arm/include/asm/mach/arch.h +2 -0
@@ -8,6 +8,8 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/types.h>
+
 #ifndef __ASSEMBLY__
 
Quoted 6 lines
Quoted 4 lines
arch/arm/include/asm/mach/arch.h +0 -0
 struct tag;

or if a better option would be to re-arrange the include directives in various at91xxx_devices.c files?

Include files should be self-contained, so asm/mach/arch.h is the right place.

Nicolas,
are you happy to come up with a proper patch to fix the issue?

#3 lore raw

On 04/30/2013 01:58 PM, Stefano Stabellini :

Quoted 17 lines · Geert Uytterhoeven
Quoted 16 lines · Nicolas Ferre
Quoted 15 lines

So, I am wondering if the best correction is to add the types.h header file in the asm/mach/arch.h file, like this:

arch/arm/include/asm/mach/arch.h +2 -0
@@ -8,6 +8,8 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/types.h>
+
 #ifndef __ASSEMBLY__
 
 struct tag;
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

or if a better option would be to re-arrange the include directives in various at91xxx_devices.c files?

Include files should be self-contained, so asm/mach/arch.h is the right place.

Nicolas,
are you happy to come up with a proper patch to fix the issue?

Yep, sent now.

Bye,

Signature · 1 line
Nicolas Ferre
#4 lore raw
In reply to Stefano Stabellini
Quoted 17 lines · Stefano Stabellini
Quoted 16 lines · Geert Uytterhoeven
Quoted 15 lines · Nicolas Ferre

So, I am wondering if the best correction is to add the types.h header file in the asm/mach/arch.h file, like this:

arch/arm/include/asm/mach/arch.h +2 -0
@@ -8,6 +8,8 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/types.h>
+
 #ifndef __ASSEMBLY__
 
 struct tag;
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

or if a better option would be to re-arrange the include directives in various at91xxx_devices.c files?

Include files should be self-contained, so asm/mach/arch.h is the right place.

Nicolas,
are you happy to come up with a proper patch to fix the issue?

I'd prefer if you just folded the above include into the original patch, unless this has been pulled already.

Nicolas

#5 lore raw
Quoted 24 lines · Nicolas Pitre
Quoted 22 lines · Stefano Stabellini
Quoted 20 lines · Geert Uytterhoeven
Quoted 15 lines · Nicolas Ferre

So, I am wondering if the best correction is to add the types.h header file in the asm/mach/arch.h file, like this:

arch/arm/include/asm/mach/arch.h +2 -0
@@ -8,6 +8,8 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/types.h>
+
 #ifndef __ASSEMBLY__
 
 struct tag;
Quoted 2 lines

or if a better option would be to re-arrange the include directives in various at91xxx_devices.c files?

Include files should be self-contained, so asm/mach/arch.h is the right place.

Quoted 5 lines
Quoted 2 lines

Nicolas,
are you happy to come up with a proper patch to fix the issue?

I'd prefer if you just folded the above include into the original patch, unless this has been pulled already.

No, I'll exploit the opportunity to resend the patch series and issue a PULL request for the arm-soc tree.

#6 lore raw

PATCH 1/1 ARM: add the "bool" type definition to asm/mach/arch.h

In reply to Nicolas Ferre

Addition of boolean field to machine_desc structure in commit 4dbfa9a25367cfa91aec0e56d75a6905d3242cd3 (ARM: Enable selection of SMP operations at boot time) was triggering compilation errors like:

CC arch/arm/mach-at91/at91sam9260_devices.o
In file included from arch/arm/mach-at91/at91sam9260_devices.c:12:0:
arch/arm/include/asm/mach/arch.h:46:2: error: expected specifier-qualifier-list before "bool"

So, we add the definition of "bool" by including the linux/types.h file to asm/mach/arch.h and make it self-contained.

---
 arch/arm/include/asm/mach/arch.h | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/include/asm/mach/arch.h +2 -0
index af8c54c..75bf079 100644
@@ -8,6 +8,8 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/types.h>
+
 #ifndef __ASSEMBLY__
 
 struct tag;
Signature · 1 line
1.8.0
Acked-by on v1 1/1
#7 lore raw

Re: [PATCH] ARM: add the "bool" type definition to asm/mach/arch.h

Quoted 4 lines · Nicolas Ferre

Addition of boolean field to machine_desc structure in commit 4dbfa9a25367cfa91aec0e56d75a6905d3242cd3 (ARM: Enable selection of SMP operations at boot time) was triggering compilation errors like:

Quoted 8 lines

CC arch/arm/mach-at91/at91sam9260_devices.o
In file included from arch/arm/mach-at91/at91sam9260_devices.c:12:0:
arch/arm/include/asm/mach/arch.h:46:2: error: expected specifier-qualifier-list before "bool"

So, we add the definition of "bool" by including the linux/types.h file to asm/mach/arch.h and make it self-contained.

Quoted 19 lines
 arch/arm/include/asm/mach/arch.h | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/include/asm/mach/arch.h +2 -0
index af8c54c..75bf079 100644
@@ -8,6 +8,8 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/types.h>
+
 #ifndef __ASSEMBLY__
 
 struct tag;
Signature · 1 line
1.8.0