summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7/tegra2
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-06-16 13:11:41 -0700
committerSimon Glass <sjg@chromium.org>2011-08-29 10:39:31 -0700
commitfea2a094904aa9fd76ae423339927dcd2e058049 (patch)
treed99fb80e4567509f238fe67d66694f03be58ca42 /arch/arm/cpu/armv7/tegra2
parent84d9e903f1b6d9c48e3615fd4bb5b2eee3ff79a4 (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 'arch/arm/cpu/armv7/tegra2')
-rw-r--r--arch/arm/cpu/armv7/tegra2/clock.c11
-rw-r--r--arch/arm/cpu/armv7/tegra2/pinmux.c8
2 files changed, 2 insertions, 17 deletions
diff --git a/arch/arm/cpu/armv7/tegra2/clock.c b/arch/arm/cpu/armv7/tegra2/clock.c
index 55d955aefd..fe7f4a3030 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 4334e7b6ed..013a39aca1 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