kernel: mutex: Change variable declaration

This is not violating any MISRA-C rule, though, it seems to be
triggering a false (rule 9.1) positive in some static analysis
tools. Nevertheless, it is more readable declare all variables in the
same scope together.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2018-11-01 15:17:03 -07:00 committed by Anas Nashif
commit 4369363f6c

View file

@ -209,6 +209,7 @@ Z_SYSCALL_HANDLER(k_mutex_lock, mutex, timeout)
void _impl_k_mutex_unlock(struct k_mutex *mutex)
{
u32_t key;
struct k_thread *new_owner;
__ASSERT(mutex->lock_count > 0U, "");
__ASSERT(mutex->owner == _current, "");
@ -230,7 +231,7 @@ void _impl_k_mutex_unlock(struct k_mutex *mutex)
adjust_owner_prio(mutex, mutex->owner_orig_prio);
struct k_thread *new_owner = _unpend_first_thread(&mutex->wait_q);
new_owner = _unpend_first_thread(&mutex->wait_q);
mutex->owner = new_owner;