include: sys: Simplify sys_mutex_unlock
Remove redundant if() statements that are already included with k_mutex_unlock() Relates to issue #32994 Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
This commit is contained in:
parent
7664171518
commit
1c9712aa2a
1 changed files with 1 additions and 10 deletions
|
@ -156,16 +156,7 @@ static inline int sys_mutex_lock(struct sys_mutex *mutex, k_timeout_t timeout)
|
||||||
|
|
||||||
static inline int sys_mutex_unlock(struct sys_mutex *mutex)
|
static inline int sys_mutex_unlock(struct sys_mutex *mutex)
|
||||||
{
|
{
|
||||||
if (mutex->kernel_mutex.lock_count == 0) {
|
return k_mutex_unlock(&mutex->kernel_mutex);
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mutex->kernel_mutex.owner != _current) {
|
|
||||||
return -EPERM;
|
|
||||||
}
|
|
||||||
|
|
||||||
k_mutex_unlock(&mutex->kernel_mutex);
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_USERSPACE */
|
#endif /* CONFIG_USERSPACE */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue