summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/cpu/armv7/tegra2/clock.c2
-rw-r--r--common/cmd_vboot_twostop.c2
-rw-r--r--include/common.h25
3 files changed, 18 insertions, 11 deletions
diff --git a/arch/arm/cpu/armv7/tegra2/clock.c b/arch/arm/cpu/armv7/tegra2/clock.c
index 7227e5850a..b3a4b7e105 100644
--- a/arch/arm/cpu/armv7/tegra2/clock.c
+++ b/arch/arm/cpu/armv7/tegra2/clock.c
@@ -451,7 +451,6 @@ unsigned long clock_start_pll(enum clock_id clkid, u32 divm, u32 divn,
return timer_get_future_us(CLOCK_PLL_STABLE_DELAY_US);
}
-#ifdef DEBUG
/* return 1 if a peripheral ID is in range and valid */
static int clock_periph_id_isvalid(enum periph_id id)
{
@@ -479,7 +478,6 @@ static int clock_periph_id_isvalid(enum periph_id id)
}
return 0;
}
-#endif
/* Returns a pointer to the clock source register for a peripheral */
static u32 *get_periph_source_reg(enum periph_id periph_id)
diff --git a/common/cmd_vboot_twostop.c b/common/cmd_vboot_twostop.c
index 593b6e5723..e8d680556a 100644
--- a/common/cmd_vboot_twostop.c
+++ b/common/cmd_vboot_twostop.c
@@ -267,7 +267,7 @@ uint32_t twostop_make_selection(struct fdt_twostop_fmap *fmap,
memset(&fparams, '\0', sizeof(fparams));
vlength = fmap->readwrite_a.vblock.length;
- assert(vlength == fmap->readwrite_b.vblock->vblock.length);
+ assert(vlength == fmap->readwrite_b.vblock.length);
fparams.verification_size_A = fparams.verification_size_B = vlength;
diff --git a/include/common.h b/include/common.h
index db35af5104..df8db31499 100644
--- a/include/common.h
+++ b/include/common.h
@@ -116,10 +116,6 @@ typedef volatile unsigned char vu_char;
#include <flash.h>
#include <image.h>
-#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
@@ -128,13 +124,26 @@ typedef volatile unsigned char vu_char;
* 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__); })
+#if defined(DEBUG)
+#define DEBUG_ASSERT 1
+#else
+#define DEBUG_ASSERT 0
+#endif
+
+#define assert(x) \
+ ({ \
+ if (DEBUG_ASSERT && !(x)) \
+ printf("Assertion failure '%s' %s line %d\n", \
+ #x, __FILE__, __LINE__); \
+ })
+
+#ifdef DEBUG
+#define debug(fmt,args...) printf (fmt ,##args)
+#define debugX(level,fmt,args...) if (DEBUG>=level) printf(fmt,##args);
+
#else
#define debug(fmt,args...)
#define debugX(level,fmt,args...)
-#define assert(x)
#endif /* DEBUG */
#define error(fmt, args...) do { \