From d76aae85ee21a212f98b64dccbbe9f7eaa71bc7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Mon, 21 Jan 2013 11:06:35 +0000 Subject: [PATCH] avoid compiler warning due to bogus comparison --- BaS_gcc/.project | 1 - BaS_gcc/sources/sysinit.c | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BaS_gcc/.project b/BaS_gcc/.project index a81375b..f516738 100644 --- a/BaS_gcc/.project +++ b/BaS_gcc/.project @@ -7,7 +7,6 @@ org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, ?name? diff --git a/BaS_gcc/sources/sysinit.c b/BaS_gcc/sources/sysinit.c index 1448e43..fe34395 100644 --- a/BaS_gcc/sources/sysinit.c +++ b/BaS_gcc/sources/sysinit.c @@ -37,7 +37,7 @@ extern void xprintf_before_copy(const char *fmt, ...); extern void flush_and_invalidate_caches_before_copy(void); #define flush_and_invalidate_caches flush_and_invalidate_caches_before_copy -#define UNUSED(x) (void)(x) /* Unused variable */ +#define UNUSED(x) (void)(x) /* Unused variable */ extern volatile long _VRAM; /* start address of video ram from linker script */ @@ -45,7 +45,7 @@ extern volatile long _VRAM; /* start address of video ram from linker script */ * wait for the specified number of us on slice timer 0. Replaces the original routines that had * the number of useconds to wait for hardcoded in their name. */ -inline void wait(uint32_t us) +inline __attribute__((always_inline)) void wait(uint32_t us) { uint32_t target = MCF_SLT_SCNT(0) - (us * 132); @@ -56,7 +56,7 @@ inline void wait(uint32_t us) * the same as above, with a checker function which gets called while * busy waiting and allows for an early return if it returns true */ -inline bool waitfor(uint32_t us, int (*condition)(void)) +inline __attribute__((always_inline)) bool waitfor(uint32_t us, int (*condition)(void)) { uint32_t target = MCF_SLT_SCNT(0) - (us * 132); @@ -730,7 +730,8 @@ void init_ac97(void) { vc = MCF_PSC2_PSCTB_AC97; /* FIXME: that looks more than suspicious (Fredi?) */ - if ((va & 0xE0000fff) == 0xE0000800 & vb == 0x02000000 & vc == 0x00000000) { + /* fixed with parentheses to avoid compiler warnings, but this looks still more than wrong to me */ + if (((va & 0xE0000fff) == 0xE0000800) & (vb == 0x02000000) & (vc == 0x00000000)) { goto livo; } }