Skip to content

Commit

Permalink
kernel; Checking functions return
Browse files Browse the repository at this point in the history
Checking the return of some scattered functions across kernel.
MISRA-C requires that all non-void functions have their return value
checked, though, in some cases there is nothing to do. Just
acknowledging it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
  • Loading branch information
Flavio Ceolin committed Sep 13, 2018
1 parent 8ed4493 commit cde5ff0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kernel/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void _sys_device_do_config_level(int level)
info++) {
struct device_config *device = info->config;

device->init(info);
(void)device->init(info);
_k_object_init(info);
}
}
Expand Down
4 changes: 2 additions & 2 deletions kernel/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ K_STACK_DEFINE(async_msg_free, CONFIG_NUM_MBOX_ASYNC_MSGS);
/* allocate an asynchronous message descriptor */
static inline void mbox_async_alloc(struct k_mbox_async **async)
{
k_stack_pop(&async_msg_free, (u32_t *)async, K_FOREVER);
(void)k_stack_pop(&async_msg_free, (u32_t *)async, K_FOREVER);
}

/* free an asynchronous message descriptor */
Expand Down Expand Up @@ -332,7 +332,7 @@ void k_mbox_async_put(struct k_mbox *mbox, struct k_mbox_msg *tx_msg,
async->tx_msg._syncing_thread = (struct k_thread *)&async->thread;
async->tx_msg._async_sem = sem;

mbox_message_put(mbox, &async->tx_msg, K_FOREVER);
(void)mbox_message_put(mbox, &async->tx_msg, K_FOREVER);
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion kernel/pipes.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ K_STACK_DEFINE(pipe_async_msgs, CONFIG_NUM_PIPE_ASYNC_MSGS);
/* Allocate an asynchronous message descriptor */
static void pipe_async_alloc(struct k_pipe_async **async)
{
k_stack_pop(&pipe_async_msgs, (u32_t *)async, K_FOREVER);
(void)k_stack_pop(&pipe_async_msgs, (u32_t *)async, K_FOREVER);
}

/* Free an asynchronous message descriptor */
Expand Down
4 changes: 2 additions & 2 deletions kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void smp_init(void)
{
atomic_t start_flag;

atomic_clear(&start_flag);
(void)atomic_clear(&start_flag);

#if defined(CONFIG_SMP) && CONFIG_MP_NUM_CPUS > 1
_arch_start_cpu(1, _interrupt_stack1, CONFIG_ISR_STACK_SIZE,
Expand All @@ -113,5 +113,5 @@ void smp_init(void)
smp_init_top, &start_flag);
#endif

atomic_set(&start_flag, 1);
(void)atomic_set(&start_flag, 1);
}

0 comments on commit cde5ff0

Please sign in to comment.