From 2163d074010351defee2e4346c94daef0a9107ea Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Thu, 12 Sep 2019 09:00:19 +0100 Subject: [PATCH] Prevent unreachable statements and correct variable sizes. --- drivers/USBAudio.h | 4 ++-- rtos/source/Semaphore.cpp | 3 ++- rtos/source/TARGET_CORTEX/mbed_rtos_rtx.c | 1 - rtos/source/TARGET_CORTEX/mbed_rtx_handlers.c | 3 --- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/USBAudio.h b/drivers/USBAudio.h index 6072afdf0a9..58a84cd69db 100644 --- a/drivers/USBAudio.h +++ b/drivers/USBAudio.h @@ -373,8 +373,8 @@ class USBAudio: protected USBDevice { usb_ep_t _episo_in; // tx endpoint // channel config in the configuration descriptor: master, left, right - uint8_t _channel_config_rx; - uint8_t _channel_config_tx; + uint16_t _channel_config_rx; + uint16_t _channel_config_tx; // configuration descriptor uint8_t _config_descriptor[183]; diff --git a/rtos/source/Semaphore.cpp b/rtos/source/Semaphore.cpp index 86d5db6d979..bcedd99bdc1 100644 --- a/rtos/source/Semaphore.cpp +++ b/rtos/source/Semaphore.cpp @@ -212,8 +212,9 @@ osStatus Semaphore::release(void) return osErrorResource; } } while (!core_util_atomic_cas_s32(&_count, &old_count, old_count + 1)); -#endif + return osOK; +#endif // MBED_CONF_RTOS_PRESENT } Semaphore::~Semaphore() diff --git a/rtos/source/TARGET_CORTEX/mbed_rtos_rtx.c b/rtos/source/TARGET_CORTEX/mbed_rtos_rtx.c index 39f02787c77..5792a7bdc10 100644 --- a/rtos/source/TARGET_CORTEX/mbed_rtos_rtx.c +++ b/rtos/source/TARGET_CORTEX/mbed_rtos_rtx.c @@ -115,5 +115,4 @@ MBED_NORETURN void mbed_rtos_start() osKernelStart(); MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_INITIALIZATION_FAILED), "Failed to start RTOS"); - while (1); // Code should never get here } diff --git a/rtos/source/TARGET_CORTEX/mbed_rtx_handlers.c b/rtos/source/TARGET_CORTEX/mbed_rtx_handlers.c index b5e46f812e8..cbc48e08f50 100644 --- a/rtos/source/TARGET_CORTEX/mbed_rtx_handlers.c +++ b/rtos/source/TARGET_CORTEX/mbed_rtx_handlers.c @@ -80,9 +80,6 @@ __NO_RETURN uint32_t osRtxErrorNotify(uint32_t code, void *object_id) MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_KERNEL, MBED_ERROR_CODE_UNKNOWN), "CMSIS-RTOS error: Unknown", code); break; } - - /* That shouldn't be reached */ - for (;;) {} } #if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED