diff --git a/include/logging/log_msg2.h b/include/logging/log_msg2.h index 08f1177ae71..7c591bab6a1 100644 --- a/include/logging/log_msg2.h +++ b/include/logging/log_msg2.h @@ -28,7 +28,7 @@ extern "C" { #define LOG_MSG2_DEBUG 0 #define LOG_MSG2_DBG(...) IF_ENABLED(LOG_MSG2_DEBUG, (printk(__VA_ARGS__))) -#if CONFIG_LOG_TIMESTAMP_64BIT +#ifdef CONFIG_LOG_TIMESTAMP_64BIT typedef uint64_t log_timestamp_t; #else typedef uint32_t log_timestamp_t; @@ -137,7 +137,7 @@ enum z_log_msg2_mode { /* Messages are aligned to alignment required by cbprintf package. */ #define Z_LOG_MSG2_ALIGNMENT CBPRINTF_PACKAGE_ALIGNMENT -#if CONFIG_LOG2_USE_VLA +#ifdef CONFIG_LOG2_USE_VLA #define Z_LOG_MSG2_ON_STACK_ALLOC(ptr, len) \ long long _ll_buf[ceiling_fraction(len, sizeof(long long))]; \ long double _ld_buf[ceiling_fraction(len, sizeof(long double))]; \ @@ -235,7 +235,7 @@ do { \ z_log_msg2_static_create((void *)_source, _desc, _msg->data, _data); \ } while (0) -#if CONFIG_LOG_SPEED +#ifdef CONFIG_LOG_SPEED #define Z_LOG_MSG2_SIMPLE_CREATE(_domain_id, _source, _level, ...) do { \ int _plen; \ CBPRINTF_STATIC_PACKAGE(NULL, 0, _plen, Z_LOG_MSG2_ALIGN_OFFSET, \ @@ -343,7 +343,7 @@ do { \ * * @param ... Optional string with arguments (fmt, ...). It may be empty. */ -#if CONFIG_LOG2_ALWAYS_RUNTIME +#ifdef CONFIG_LOG2_ALWAYS_RUNTIME #define Z_LOG_MSG2_CREATE2(_try_0cpy, _mode, _cstr_cnt, _domain_id, _source,\ _level, _data, _dlen, ...) \ do {\ @@ -353,7 +353,7 @@ do {\ Z_LOG_FMT_ARGS(_fmt, ##__VA_ARGS__));\ _mode = Z_LOG_MSG2_MODE_RUNTIME; \ } while (0) -#elif CONFIG_LOG2_MODE_IMMEDIATE /* CONFIG_LOG2_ALWAYS_RUNTIME */ +#elif defined(CONFIG_LOG2_MODE_IMMEDIATE) /* CONFIG_LOG2_ALWAYS_RUNTIME */ #define Z_LOG_MSG2_CREATE2(_try_0cpy, _mode, _cstr_cnt, _domain_id, _source,\ _level, _data, _dlen, ...) \ do { \ diff --git a/include/sys/cbprintf_internal.h b/include/sys/cbprintf_internal.h index bad41f7ba1c..8137ccfd94f 100644 --- a/include/sys/cbprintf_internal.h +++ b/include/sys/cbprintf_internal.h @@ -315,7 +315,7 @@ union z_cbprintf_hdr { * if argument is a stirng literal. Suppression is added here instead of * the macro which generates the warning to not slow down the compiler. */ -#if __clang__ == 1 +#ifdef __clang__ #define Z_CBPRINTF_SUPPRESS_SIZEOF_ARRAY_DECAY \ _Pragma("GCC diagnostic ignored \"-Wsizeof-array-decay\"") #else