coding guidelines: comply with MISRA Rule 2.2

- avoided dead stores

Signed-off-by: Hess Nathan <nhess@baumer.com>
This commit is contained in:
Hess Nathan 2024-04-29 16:31:47 +02:00 committed by Fabio Baltieri
parent 0012e1ff76
commit 7659cfd4dc
4 changed files with 5 additions and 5 deletions

View File

@ -172,7 +172,7 @@ SYS_INIT(init_mem_slab_obj_core_list, PRE_KERNEL_1,
int k_mem_slab_init(struct k_mem_slab *slab, void *buffer,
size_t block_size, uint32_t num_blocks)
{
int rc = 0;
int rc;
slab->info.num_blocks = num_blocks;
slab->info.block_size = block_size;

View File

@ -1370,7 +1370,7 @@ void z_impl_k_thread_abort(struct k_thread *thread)
int z_impl_k_thread_join(struct k_thread *thread, k_timeout_t timeout)
{
k_spinlock_key_t key = k_spin_lock(&_sched_spinlock);
int ret = 0;
int ret;
SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_thread, join, thread, timeout);

View File

@ -131,7 +131,7 @@ static inline void z_vrfy_k_sem_give(struct k_sem *sem)
int z_impl_k_sem_take(struct k_sem *sem, k_timeout_t timeout)
{
int ret = 0;
int ret;
__ASSERT(((arch_is_in_isr() == false) ||
K_TIMEOUT_EQ(timeout, K_NO_WAIT)), "");

View File

@ -271,7 +271,7 @@ static inline int queue_submit_locked(struct k_work_q *queue,
return -EINVAL;
}
int ret = -EBUSY;
int ret;
bool chained = (_current == &queue->thread) && !k_is_in_isr();
bool draining = flag_test(&queue->flags, K_WORK_QUEUE_DRAIN_BIT);
bool plugged = flag_test(&queue->flags, K_WORK_QUEUE_PLUGGED_BIT);
@ -1018,7 +1018,7 @@ int k_work_reschedule_for_queue(struct k_work_q *queue,
SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_work, reschedule_for_queue, queue, dwork, delay);
int ret = 0;
int ret;
k_spinlock_key_t key = k_spin_lock(&lock);
/* Remove any active scheduling. */