From 11dad7732a260403568803e68271bfd6659c2a64 Mon Sep 17 00:00:00 2001 From: Jason Chen CJ Date: Sun, 25 Mar 2018 17:44:20 +0800 Subject: [PATCH] debug: make ASSERT empty under release version ASSERT is only for debug purpose, for release version, it should try error handling instead of deadloop there. v1: - change the ASSERT under release version to empty code TODO: revise all ASSERT usage Signed-off-by: Jason Chen CJ Acked-by: Eddie Dong (Eddie.dong@intel.com) --- include/debug/assert.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include/debug/assert.h b/include/debug/assert.h index 83b26c1b5..04e98985b 100644 --- a/include/debug/assert.h +++ b/include/debug/assert.h @@ -40,12 +40,7 @@ void __assert(uint32_t line, const char *file, char *txt); __assert(__LINE__, __FILE__, "fatal error");\ } #else -#define ASSERT(x, ...) \ - if (!(x)) { \ - do { \ - asm volatile ("pause" ::: "memory"); \ - } while (1); \ - } +#define ASSERT(x, ...) do { } while(0) #endif /* Force a compilation error if condition is false */