kernel: Ignore _pend_current_thread return in some cases
There are some cases that there is nothing to do with _pend_current_thread() return (that is _Swap return value). As MISRA-C requires that all non-void functions have their return value checked, we are explicitly ignoring it when there is nothing to do. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
da49f2e440
commit
1663ca8590
3 changed files with 4 additions and 4 deletions
|
|
@ -91,7 +91,7 @@ int k_mem_pool_alloc(struct k_mem_pool *p, struct k_mem_block *block,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
_pend_current_thread(irq_lock(), &p->wait_q, timeout);
|
(void)_pend_current_thread(irq_lock(), &p->wait_q, timeout);
|
||||||
|
|
||||||
if (timeout != K_FOREVER) {
|
if (timeout != K_FOREVER) {
|
||||||
timeout = end - _tick_get();
|
timeout = end - _tick_get();
|
||||||
|
|
|
||||||
|
|
@ -565,7 +565,7 @@ int _k_pipe_put_internal(struct k_pipe *pipe, struct k_pipe_async *async_desc,
|
||||||
*/
|
*/
|
||||||
key = irq_lock();
|
key = irq_lock();
|
||||||
_sched_unlock_no_reschedule();
|
_sched_unlock_no_reschedule();
|
||||||
_pend_current_thread(key, &pipe->wait_q.writers, timeout);
|
(void)_pend_current_thread(key, &pipe->wait_q.writers, timeout);
|
||||||
} else {
|
} else {
|
||||||
k_sched_unlock();
|
k_sched_unlock();
|
||||||
}
|
}
|
||||||
|
|
@ -707,7 +707,7 @@ int _impl_k_pipe_get(struct k_pipe *pipe, void *data, size_t bytes_to_read,
|
||||||
_current->base.swap_data = &pipe_desc;
|
_current->base.swap_data = &pipe_desc;
|
||||||
key = irq_lock();
|
key = irq_lock();
|
||||||
_sched_unlock_no_reschedule();
|
_sched_unlock_no_reschedule();
|
||||||
_pend_current_thread(key, &pipe->wait_q.readers, timeout);
|
(void)_pend_current_thread(key, &pipe->wait_q.readers, timeout);
|
||||||
} else {
|
} else {
|
||||||
k_sched_unlock();
|
k_sched_unlock();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,7 @@ u32_t _impl_k_timer_status_sync(struct k_timer *timer)
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
if (timer->timeout.delta_ticks_from_prev != _INACTIVE) {
|
if (timer->timeout.delta_ticks_from_prev != _INACTIVE) {
|
||||||
/* wait for timer to expire or stop */
|
/* wait for timer to expire or stop */
|
||||||
_pend_current_thread(key, &timer->wait_q, K_FOREVER);
|
(void)_pend_current_thread(key, &timer->wait_q, K_FOREVER);
|
||||||
|
|
||||||
/* get updated timer status */
|
/* get updated timer status */
|
||||||
key = irq_lock();
|
key = irq_lock();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue