From 2ecc7cfa55d8e6ae63d17e73f191ce374cb48b35 Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Fri, 8 Mar 2019 14:53:42 -0800 Subject: [PATCH] kernel: Make _is_thread_prevented_from_running return a bool This function was returning an essentially boolean value. Just changing the signature to return a bool. MISRA-C rule 14.4 Signed-off-by: Flavio Ceolin --- kernel/include/ksched.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/include/ksched.h b/kernel/include/ksched.h index ebd262d7607..c7c927ef377 100644 --- a/kernel/include/ksched.h +++ b/kernel/include/ksched.h @@ -90,12 +90,12 @@ static inline bool z_is_thread_pending(struct k_thread *thread) return !!(thread->base.thread_state & _THREAD_PENDING); } -static inline int z_is_thread_prevented_from_running(struct k_thread *thread) +static inline bool z_is_thread_prevented_from_running(struct k_thread *thread) { u8_t state = thread->base.thread_state; - return state & (_THREAD_PENDING | _THREAD_PRESTART | _THREAD_DEAD | - _THREAD_DUMMY | _THREAD_SUSPENDED); + return (state & (_THREAD_PENDING | _THREAD_PRESTART | _THREAD_DEAD | + _THREAD_DUMMY | _THREAD_SUSPENDED)) != 0; }