From 845fdbb7c024f9d4ab2755bc8a4c331edd0b897f Mon Sep 17 00:00:00 2001 From: Niranjhana N Date: Thu, 23 Aug 2018 13:27:42 +0530 Subject: [PATCH] lib: cmsis_rtos_v1: replace an else case Replace an else-if case in osSemaphoreWait with else to account for both EBUSY and EAGAIN return values from k_sem_take. The return value would be 0 for osSemaphoreWait in both cases. Signed-off-by: Niranjhana N --- lib/cmsis_rtos_v1/cmsis_semaphore.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/cmsis_rtos_v1/cmsis_semaphore.c b/lib/cmsis_rtos_v1/cmsis_semaphore.c index 69c93f2656a..41da2b9145c 100644 --- a/lib/cmsis_rtos_v1/cmsis_semaphore.c +++ b/lib/cmsis_rtos_v1/cmsis_semaphore.c @@ -68,11 +68,9 @@ int32_t osSemaphoreWait(osSemaphoreId semaphore_id, uint32_t timeout) */ if (status == 0) { return k_sem_count_get(semaphore) + 1; - } else if (status == -EAGAIN) { + } else { return 0; } - - return -1; } /**