Skip to content
Permalink
Browse files

assert: Explicitly ignoring printk() return

__ASSERT macro will either exit the program (POSIX port) or infint
loop. In both cases printk's return is not necessary.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
  • Loading branch information...
ceolin authored and nashif committed Aug 13, 2018
1 parent cc74ad0 commit 2626dda0186fbd40876af7999bca59c40662a46b
Showing with 10 additions and 10 deletions.
  1. +10 −10 include/misc/__assert.h
@@ -90,16 +90,16 @@ extern void posix_exit(int exit_code);
}
#endif

#define __ASSERT(test, fmt, ...) \
do { \
if (!(test)) { \
printk("ASSERTION FAIL [%s] @ %s:%d:\n\t", \
_STRINGIFY(test), \
__FILE__, \
__LINE__); \
printk(fmt, ##__VA_ARGS__); \
__ASSERT_POST; \
} \
#define __ASSERT(test, fmt, ...) \
do { \
if (!(test)) { \
(void)printk("ASSERTION FAIL [%s] @ %s:%d:\n\t", \
_STRINGIFY(test), \
__FILE__, \
__LINE__); \
(void)printk(fmt, ##__VA_ARGS__); \
__ASSERT_POST; \
} \
} while ((0))

#define __ASSERT_EVAL(expr1, expr2, test, fmt, ...) \

0 comments on commit 2626dda

Please sign in to comment.
You can’t perform that action at this time.