kernel: Make if/iteration evaluate boolean operands

Controlling expression of if and iteration statements must have a
boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2019-03-14 14:32:45 -07:00 committed by Anas Nashif
commit 2df02cc8db
6 changed files with 11 additions and 11 deletions

View file

@ -87,7 +87,7 @@ static inline bool z_is_idle_thread(void *entry_point)
static inline bool z_is_thread_pending(struct k_thread *thread)
{
return !!(thread->base.thread_state & _THREAD_PENDING);
return (thread->base.thread_state & _THREAD_PENDING) != 0;
}
static inline bool z_is_thread_prevented_from_running(struct k_thread *thread)
@ -117,7 +117,7 @@ static inline bool z_has_thread_started(struct k_thread *thread)
static inline bool z_is_thread_state_set(struct k_thread *thread, u32_t state)
{
return !!(thread->base.thread_state & state);
return (thread->base.thread_state & state) != 0;
}
static inline bool z_is_thread_queued(struct k_thread *thread)