diff --git a/kernel/include/kswap.h b/kernel/include/kswap.h index d07c76b310e..110e9b16cf4 100644 --- a/kernel/include/kswap.h +++ b/kernel/include/kswap.h @@ -60,7 +60,7 @@ static inline void wait_for_switch(struct k_thread *thread) */ static ALWAYS_INLINE unsigned int do_swap(unsigned int key, struct k_spinlock *lock, - int is_spinlock) + bool is_spinlock) { ARG_UNUSED(lock); struct k_thread *new_thread, *old_thread; @@ -161,17 +161,17 @@ static ALWAYS_INLINE unsigned int do_swap(unsigned int key, static inline int z_swap_irqlock(unsigned int key) { - return do_swap(key, NULL, 0); + return do_swap(key, NULL, false); } static inline int z_swap(struct k_spinlock *lock, k_spinlock_key_t key) { - return do_swap(key.key, lock, 1); + return do_swap(key.key, lock, true); } static inline void z_swap_unlocked(void) { - (void) do_swap(arch_irq_lock(), NULL, 1); + (void) do_swap(arch_irq_lock(), NULL, true); } #else /* !CONFIG_USE_SWITCH */ diff --git a/kernel/mmu.c b/kernel/mmu.c index 47473f4a2dd..9ab52a3030a 100644 --- a/kernel/mmu.c +++ b/kernel/mmu.c @@ -69,7 +69,7 @@ static bool page_frames_initialized; #define COLOR(x) printk(_CONCAT(ANSI_, x)) #else -#define COLOR(x) do { } while (0) +#define COLOR(x) do { } while (false) #endif /* LCOV_EXCL_START */ diff --git a/kernel/sched.c b/kernel/sched.c index 99645337e54..3d323fdb90a 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -354,8 +354,8 @@ static ALWAYS_INLINE struct k_thread *next_up(void) end_thread(_current); } - int queued = z_is_thread_queued(_current); - int active = !z_is_thread_prevented_from_running(_current); + bool queued = z_is_thread_queued(_current); + bool active = !z_is_thread_prevented_from_running(_current); if (thread == NULL) { thread = _current_cpu->idle_thread; diff --git a/kernel/smp.c b/kernel/smp.c index 39d44f2fa2a..ee0ca89f940 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -28,7 +28,7 @@ unsigned int z_smp_global_lock(void) void z_smp_global_unlock(unsigned int key) { - if (_current->base.global_lock_count) { + if (_current->base.global_lock_count != 0U) { _current->base.global_lock_count--; if (!_current->base.global_lock_count) { diff --git a/kernel/timer.c b/kernel/timer.c index cf59ba4d304..d5f0a05e7f8 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -161,7 +161,7 @@ void z_impl_k_timer_stop(struct k_timer *timer) { SYS_PORT_TRACING_OBJ_FUNC(k_timer, stop, timer); - int inactive = z_abort_timeout(&timer->timeout) != 0; + bool inactive = (z_abort_timeout(&timer->timeout) != 0); if (inactive) { return;