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:
parent
abdb8785cb
commit
4369363f6c
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue