From 5a22e461b5841795c592a08b14c949c46c74e261 Mon Sep 17 00:00:00 2001 From: Antonio Nino Diaz Date: Tue, 28 Aug 2018 11:44:44 +0100 Subject: Fix MISRA defects in log helpers No functional changes. Change-Id: I850f08718abb69d5d58856b0e3de036266d8c2f4 Signed-off-by: Antonio Nino Diaz --- include/common/debug.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'include/common/debug.h') diff --git a/include/common/debug.h b/include/common/debug.h index ab3e15a7..8ee55b88 100644 --- a/include/common/debug.h +++ b/include/common/debug.h @@ -7,6 +7,8 @@ #ifndef DEBUG_H #define DEBUG_H +#include + /* * The log output macros print output to the console. These macros produce * compiled log output only if the LOG_LEVEL defined in the makefile (or the @@ -18,12 +20,12 @@ * WARN("Warning %s.\n", "message") -> WARNING: Warning message. */ -#define LOG_LEVEL_NONE 0 -#define LOG_LEVEL_ERROR 10 -#define LOG_LEVEL_NOTICE 20 -#define LOG_LEVEL_WARNING 30 -#define LOG_LEVEL_INFO 40 -#define LOG_LEVEL_VERBOSE 50 +#define LOG_LEVEL_NONE U(0) +#define LOG_LEVEL_ERROR U(10) +#define LOG_LEVEL_NOTICE U(20) +#define LOG_LEVEL_WARNING U(30) +#define LOG_LEVEL_INFO U(40) +#define LOG_LEVEL_VERBOSE U(50) #ifndef __ASSEMBLY__ #include @@ -50,10 +52,10 @@ */ #define no_tf_log(fmt, ...) \ do { \ - if (0) { \ + if (false) { \ tf_log(fmt, ##__VA_ARGS__); \ } \ - } while (0) + } while (false) #if LOG_LEVEL >= LOG_LEVEL_NOTICE # define NOTICE(...) tf_log(LOG_MARKER_NOTICE __VA_ARGS__) -- cgit v1.2.3