From 94f88e502f078136646ba6327765997e6d60ca19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Fri, 5 Mar 2021 20:24:52 +0000 Subject: [PATCH] lib: os: Simplify z_impl_z_sys_mutex_kernel_unlock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove one redundant if() statement already included with k_mutex_unlock() Signed-off-by: Guðni Már Gilbert --- lib/os/mutex.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/os/mutex.c b/lib/os/mutex.c index 953ee57cf2c..9eaa0406936 100644 --- a/lib/os/mutex.c +++ b/lib/os/mutex.c @@ -60,12 +60,7 @@ int z_impl_z_sys_mutex_kernel_unlock(struct sys_mutex *mutex) return -EINVAL; } - if (kernel_mutex->owner != _current) { - return -EPERM; - } - - k_mutex_unlock(kernel_mutex); - return 0; + return k_mutex_unlock(kernel_mutex); } static inline int z_vrfy_z_sys_mutex_kernel_unlock(struct sys_mutex *mutex)