diff options
author | Simon Glass <sjg@chromium.org> | 2011-06-16 13:11:41 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:39:31 -0700 |
commit | fea2a094904aa9fd76ae423339927dcd2e058049 (patch) | |
tree | d99fb80e4567509f238fe67d66694f03be58ca42 /include/malloc.h | |
parent | 84d9e903f1b6d9c48e3615fd4bb5b2eee3ff79a4 (diff) |
Add assert() for debug assertions
assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.
It turns out that assert() is defined separately in a few places in U-Boot
with various meanings.
Build errors exposed by this change (and defining DEBUG) are also fixed in
this commit.
BUG=chromium-os:11623
TEST=build U-Boot for seaboard
Change-Id: I27500491d2328405694bfd65ab991d42d9641927
Reviewed-on: http://gerrit.chromium.org/gerrit/2777
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'include/malloc.h')
-rw-r--r-- | include/malloc.h | 8 |
1 files changed, 0 insertions, 8 deletions
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 |