diff options
-rw-r--r-- | arch/arm/cpu/armv7/tegra2/clock.c | 11 | ||||
-rw-r--r-- | arch/arm/cpu/armv7/tegra2/pinmux.c | 8 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-tegra2/pinmux.h | 4 | ||||
-rw-r--r-- | common/cmd_vboot.c | 6 | ||||
-rw-r--r-- | common/dlmalloc.c | 7 | ||||
-rw-r--r-- | include/common.h | 13 | ||||
-rw-r--r-- | include/malloc.h | 8 | ||||
-rw-r--r-- | lib/qsort.c | 5 |
8 files changed, 17 insertions, 45 deletions
diff --git a/arch/arm/cpu/armv7/tegra2/clock.c b/arch/arm/cpu/armv7/tegra2/clock.c index 55d955aefde..fe7f4a30305 100644 --- a/arch/arm/cpu/armv7/tegra2/clock.c +++ b/arch/arm/cpu/armv7/tegra2/clock.c @@ -30,14 +30,6 @@ #include <common.h> #include <div64.h> -#ifdef DEBUG -#define assert(x) \ - ({ if (!(x)) printf("Assertion failure '%s' %s line %d\n", \ - #x, __FILE__, __LINE__); }) -#else -#define assert(x) -#endif - /* * This is our record of the current clock rate of each clock. We don't * fill all of these in since we are only really interested in clocks which @@ -677,7 +669,8 @@ unsigned clock_adjust_periph_pll_div(enum periph_id periph_id, if (adjust_periph_pll(periph_id, parent, divider)) return -1U; debug("periph %d, rate=%d, reg=%p = %x\n", periph_id, rate, - reg, readl(get_periph_source_reg(periph_id))); + get_periph_source_reg(periph_id), + readl(get_periph_source_reg(periph_id))); /* Check what we ended up with. This shouldn't matter though */ effective_rate = clock_get_periph_rate(periph_id, parent); diff --git a/arch/arm/cpu/armv7/tegra2/pinmux.c b/arch/arm/cpu/armv7/tegra2/pinmux.c index 4334e7b6edd..013a39aca15 100644 --- a/arch/arm/cpu/armv7/tegra2/pinmux.c +++ b/arch/arm/cpu/armv7/tegra2/pinmux.c @@ -27,14 +27,6 @@ #include <asm/arch/pinmux.h> #include <common.h> -#ifdef DEBUG -#define assert(x) \ - ({ if (!(x)) printf("Assertion failure '%s' %s line %d\n", \ - #x, __FILE__, __LINE__); }) -#else -#define assert(x) -#endif - /* * This defines the order of the pin mux control bits in the registers. For * some reason there is no correspendence between the tristate, pin mux and diff --git a/arch/arm/include/asm/arch-tegra2/pinmux.h b/arch/arm/include/asm/arch-tegra2/pinmux.h index c4be95cf08e..469d742cc30 100644 --- a/arch/arm/include/asm/arch-tegra2/pinmux.h +++ b/arch/arm/include/asm/arch-tegra2/pinmux.h @@ -259,8 +259,8 @@ enum pmux_func { }; /* return 1 if a pmux_func is in range */ -#define pmux_func_isvalid(func) ((func) >= 0 && (func) < FUNC_COUNT && \ - (func) != FUNC_RSVD) +#define pmux_func_isvalid(func) ((func) >= 0 && (func) < PMUX_FUNC_COUNT && \ + (func) != PMUX_FUNC_RSVD) /* The pullup/pulldown state of a pin group */ enum pmux_pull { diff --git a/common/cmd_vboot.c b/common/cmd_vboot.c index ac067ef8567..c76126950b2 100644 --- a/common/cmd_vboot.c +++ b/common/cmd_vboot.c @@ -101,12 +101,6 @@ static int test_enable(void) return 0; } -#define assert(XCOND) do { \ - if (!(XCOND)) { \ - printf("\tassert : " #XCOND "\n"); \ - } \ -} while (0) - #define reboot() do { \ printf("\trebooting...\n"); \ reset_cpu(0); \ diff --git a/common/dlmalloc.c b/common/dlmalloc.c index e9bab09b8ea..f2080c64bae 100644 --- a/common/dlmalloc.c +++ b/common/dlmalloc.c @@ -286,13 +286,6 @@ extern "C" { */ -#ifdef DEBUG -#include <assert.h> -#else -#define assert(x) ((void)0) -#endif - - /* INTERNAL_SIZE_T is the word-size used for internal bookkeeping of chunk sizes. On a 64-bit machine, you can reduce malloc diff --git a/include/common.h b/include/common.h index 934c007c354..c037b361915 100644 --- a/include/common.h +++ b/include/common.h @@ -119,9 +119,22 @@ typedef volatile unsigned char vu_char; #ifdef DEBUG #define debug(fmt,args...) printf (fmt ,##args) #define debugX(level,fmt,args...) if (DEBUG>=level) printf(fmt,##args); + +/* + * An assertion is run-time check done in debug mode only. If DEBUG is not + * defined then it is skipped. It does not BUG or halt U-Boot, but tries to + * continue execution in any case. It is hoped that all failing assertions + * are found before release, and after release it is hoped that they don't + * matter, but in any case cannot be fixed with a reset (which will just do + * the same again). + */ +#define assert(x) \ + ({ if (!(x)) printf("Assertion failure '%s' %s line %d\n", \ + #x, __FILE__, __LINE__); }) #else #define debug(fmt,args...) #define debugX(level,fmt,args...) +#define assert(x) #endif /* DEBUG */ #define error(fmt, args...) do { \ diff --git a/include/malloc.h b/include/malloc.h index 3e145ad11c3..ecf3c678fe4 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -285,14 +285,6 @@ extern "C" { */ -#ifdef DEBUG -/* #include <assert.h> */ -#define assert(x) ((void)0) -#else -#define assert(x) ((void)0) -#endif - - /* INTERNAL_SIZE_T is the word-size used for internal bookkeeping of chunk sizes. On a 64-bit machine, you can reduce malloc diff --git a/lib/qsort.c b/lib/qsort.c index 1cc0d31c9ea..86c392c225a 100644 --- a/lib/qsort.c +++ b/lib/qsort.c @@ -17,11 +17,6 @@ #include <linux/types.h> #include <exports.h> -#if 0 -#include <assert.h> -#else -#define assert(arg) -#endif void qsort(void *base, size_t nel, |