Skip to content

Commit d9876be

Browse files
Flavio Ceolinandrewboie
authored andcommitted
kernel: Make statements evaluate boolean expressions
MISRA-C requires that the if statement has essentially Boolean type. MISRA-C rule 14.4 Signed-off-by: Flavio Ceolin <[email protected]>
1 parent f18e632 commit d9876be

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

kernel/include/timeout_q.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#include <kernel.h>
1616

17+
#include <stdbool.h>
18+
1719
#ifdef __cplusplus
1820
extern "C" {
1921
#endif
@@ -60,12 +62,12 @@ s32_t z_timeout_remaining(struct _timeout *timeout);
6062
#else
6163

6264
/* Stubs when !CONFIG_SYS_CLOCK_EXISTS */
63-
#define _init_thread_timeout(t) do {} while (0)
64-
#define _add_thread_timeout(th, to) do {} while (0 && (void *)to && (void *)th)
65+
#define _init_thread_timeout(t) do {} while (false)
66+
#define _add_thread_timeout(th, to) do {} while (false && (void *)to && (void *)th)
6567
#define _abort_thread_timeout(t) (0)
6668
#define _is_inactive_timeout(t) 0
6769
#define _get_next_timeout_expiry() (K_FOREVER)
68-
#define z_set_timeout_expiry(t, i) do {} while (0)
70+
#define z_set_timeout_expiry(t, i) do {} while (false)
6971

7072
#endif
7173

0 commit comments

Comments
 (0)