提交 5176365a 编写于 作者: H Heinrich Schuchardt 提交者: Tom Rini

log: make debug_cond() function like

Change debug_cond() such that it can be used instead of a function like
debug().
Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: NSimon Glass <sjg@chromium.org>
上级 f5abd8a6
......@@ -217,10 +217,9 @@ static inline int _log_nop(enum log_category_t cat, enum log_level_t level,
#if !_DEBUG && CONFIG_IS_ENABLED(LOG)
#define debug_cond(cond, fmt, args...) \
do { \
if (1) \
log(LOG_CATEGORY, LOGL_DEBUG, fmt, ##args); \
} while (0)
({ \
log(LOG_CATEGORY, LOGL_DEBUG, fmt, ##args); \
})
#else /* _DEBUG */
......@@ -229,11 +228,11 @@ static inline int _log_nop(enum log_category_t cat, enum log_level_t level,
* computed by a preprocessor in the best case, allowing for the best
* optimization.
*/
#define debug_cond(cond, fmt, args...) \
do { \
if (cond) \
printf(pr_fmt(fmt), ##args); \
} while (0)
#define debug_cond(cond, fmt, args...) \
({ \
if (cond) \
printf(pr_fmt(fmt), ##args); \
})
#endif /* _DEBUG */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册