Skip to contentSkip to conversation

Blackfin: don't use 'bool' when it causes problems

PATCH New Wolfgang Denk 1 participant 1 message Nov 19, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Blackfin: don't use 'bool' when it causes problems

The use of 'bool' data types in globally used header files cases build errors like this:

In file included from arch/blackfin/include/asm/blackfin.h:13:0,

                 from include/common.h:92,
                 from cmd_test.c:17:

arch/blackfin/include/asm/blackfin_local.h:54:1: error: unknown type name 'bool'

Use plain 'int' instead to avoid such kind of trouble.

---
I always had the opinion that the use of "bool" types causes more problems than it solves. This case reinforces my opinion. - wd

 arch/blackfin/cpu/os_log.c                 | 6 +++---
 arch/blackfin/include/asm/blackfin_local.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/blackfin/cpu/os_log.c +3 -3
index e1c8e29..2092d9e 100644
@@ -12,12 +12,12 @@
 #define OS_LOG_MAGIC_ADDR  ((unsigned long *)0x4f0)
 #define OS_LOG_PTR_ADDR    ((char **)0x4f4)
 
-bool bfin_os_log_check(void)
+int bfin_os_log_check(void)
 {
 	if (*OS_LOG_MAGIC_ADDR != OS_LOG_MAGIC)
-		return false;
+		return 0;
 	*OS_LOG_MAGIC_ADDR = 0;
-	return true;
+	return 1;
 }
 
 void bfin_os_log_dump(void)
arch/blackfin/include/asm/blackfin_local.h +1 -1
index ab31dcb..8ea8cde 100644
@@ -51,7 +51,7 @@ extern u_long get_dclk(void);
 
 # define bfin_revid() (bfin_read_CHIPID() >> 28)
 
-extern bool bfin_os_log_check(void);
+extern int bfin_os_log_check(void);
 extern void bfin_os_log_dump(void);
 
 extern void blackfin_icache_flush_range(const void *, const void *);
Signature · 14 lines
1.8.3.1



Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Q: Why do PCs have a reset button on the front?
A: Because they are expected to run Microsoft operating systems.