Skip to content

Commit c878e3f

Browse files
DeHessnashif
authored andcommitted
coding guidelines: comply with MISRA Rule 20.9
- avoid to use undefined macros in #if expressions Signed-off-by: Hess Nathan <[email protected]>
1 parent c30a9c4 commit c878e3f

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

include/zephyr/linker/common-ram.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
__device_states_end = .;
4444
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
4545

46-
#if CONFIG_PM_DEVICE
46+
#ifdef CONFIG_PM_DEVICE
4747
ITERABLE_SECTION_RAM(pm_device_slots, Z_LINK_ITERABLE_SUBALIGN)
4848
#endif
4949

include/zephyr/logging/log_msg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct log_msg_hdr {
7272
/* Attempting to keep best alignment. When address is 64 bit and timestamp 32
7373
* swap the order to have 16 byte header instead of 24 byte.
7474
*/
75-
#if (INTPTR_MAX > INT32_MAX) && !CONFIG_LOG_TIMESTAMP_64BIT
75+
#if (INTPTR_MAX > INT32_MAX) && !defined(CONFIG_LOG_TIMESTAMP_64BIT)
7676
log_timestamp_t timestamp;
7777
const void *source;
7878
#else

include/zephyr/sys/__assert.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,21 @@
1212

1313
#ifdef CONFIG_ASSERT
1414
#ifndef __ASSERT_ON
15+
#ifdef CONFIG_ASSERT_LEVEL
1516
#define __ASSERT_ON CONFIG_ASSERT_LEVEL
1617
#endif
1718
#endif
19+
#endif
1820

1921
#ifdef CONFIG_FORCE_NO_ASSERT
2022
#undef __ASSERT_ON
2123
#define __ASSERT_ON 0
2224
#endif
2325

26+
#ifndef __ASSERT_ON
27+
#define __ASSERT_ON 0
28+
#endif
29+
2430
#ifdef __cplusplus
2531
extern "C" {
2632
#endif

0 commit comments

Comments
 (0)