From: Gilbok Lee Date: Mon, 16 Jul 2018 07:20:20 +0000 (+0900) Subject: Add limm-radio error when convert error code X-Git-Tag: accepted/tizen/5.0/unified/20181102.014338^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F94%2F184194%2F8;p=platform%2Fcore%2Fapi%2Fradio.git Add limm-radio error when convert error code And code/log clean up [Version] 0.1.14 [Profile] Mobile, Wearable [Issue Type] Fix bugs Change-Id: Iae049e8ea71975054524dc735971712aa089154b --- diff --git a/doc/image/capi_media_radio_state_diagram.png b/doc/image/capi_media_radio_state_diagram.png old mode 100755 new mode 100644 diff --git a/include/radio.h b/include/radio.h old mode 100755 new mode 100644 diff --git a/packaging/capi-media-radio.spec b/packaging/capi-media-radio.spec index 0b247d3..4e9d161 100644 --- a/packaging/capi-media-radio.spec +++ b/packaging/capi-media-radio.spec @@ -1,6 +1,6 @@ Name: capi-media-radio Summary: A Radio library in Tizen Native API -Version: 0.1.13 +Version: 0.1.14 Release: 1 Group: API/C API License: Apache-2.0 diff --git a/src/radio.c b/src/radio.c index 9433e1f..2a0a272 100644 --- a/src/radio.c +++ b/src/radio.c @@ -35,7 +35,7 @@ do { \ if (condition) { \ } else { \ - LOGE("[%s] %s(0x%08x)", (char *)__FUNCTION__, msg, error); \ + LOGE("%s(0x%08x)", msg, error); \ return error; \ } \ } while (0) @@ -59,14 +59,14 @@ static int __convert_error_code(int code, char *func_name) { int ret = RADIO_ERROR_NONE; char *msg = "RADIO_ERROR_NONE"; - LOGI("[%s] Enter code :%x", __func__, code); + LOGI("Enter code :%x", code); switch (code) { case MM_ERROR_NONE: ret = RADIO_ERROR_NONE; msg = "RADIO_ERROR_NONE"; break; - case MM_ERROR_RADIO_NO_FREE_SPACE: + case MM_ERROR_OUT_OF_MEMORY: ret = RADIO_ERROR_OUT_OF_MEMORY; msg = "RADIO_ERROR_OUT_OF_MEMORY"; break; @@ -88,11 +88,6 @@ static int __convert_error_code(int code, char *func_name) ret = RADIO_ERROR_SOUND_POLICY; msg = "RADIO_ERROR_SOUND_POLICY"; break; - case MM_ERROR_RADIO_INTERNAL: - case MM_ERROR_RADIO_RESPONSE_TIMEOUT: - ret = RADIO_ERROR_INVALID_OPERATION; - msg = "RADIO_ERROR_INVALID_OPERATION"; - break; case MM_ERROR_RADIO_DEVICE_NOT_FOUND: ret = RADIO_ERROR_NOT_SUPPORTED; msg = "RADIO_ERROR_NOT_SUPPORTED"; @@ -102,9 +97,17 @@ static int __convert_error_code(int code, char *func_name) msg = "RADIO_ERROR_NO_ANTENNA"; break; case MM_ERROR_RADIO_DEVICE_NOT_OPENED: - default: + case MM_ERROR_RADIO_PERMISSION_DENIED: ret = RADIO_ERROR_PERMISSION_DENIED; msg = "RADIO_ERROR_PERMISSION_DENIED"; + break; + case MM_ERROR_NOT_IMPLEMENTED: + case MM_ERROR_RADIO_INTERNAL: + case MM_ERROR_RADIO_RESPONSE_TIMEOUT: + default: + ret = RADIO_ERROR_INVALID_OPERATION; + msg = "RADIO_ERROR_INVALID_OPERATION"; + break; } LOGE("[%s] %s(0x%08x) : core fw error(0x%x)", func_name, msg, ret, code); return ret; @@ -113,7 +116,7 @@ static int __convert_error_code(int code, char *func_name) static radio_state_e __convert_radio_state(MMRadioStateType state) { int converted_state = RADIO_STATE_READY; - LOGI("[%s] Enter state: %d", __func__, state); + LOGI("Enter state: %d", state); switch (state) { case MM_RADIO_STATE_PLAYING: @@ -128,7 +131,7 @@ static radio_state_e __convert_radio_state(MMRadioStateType state) converted_state = RADIO_STATE_READY; break; } - LOGI("[%s] Leave converted_state: %d", __func__, converted_state); + LOGI("Leave converted_state: %d", converted_state); return converted_state; } @@ -139,7 +142,7 @@ static int __set_callback(_radio_event_e type, radio_h radio, void *callback, vo radio_s *handle = (radio_s *)radio; handle->user_cb[type] = callback; handle->user_data[type] = user_data; - LOGI("[%s] Event type : %d", __FUNCTION__, type); + LOGI("Event type : %d", type); return RADIO_ERROR_NONE; } @@ -149,7 +152,7 @@ static int __unset_callback(_radio_event_e type, radio_h radio) radio_s *handle = (radio_s *)radio; handle->user_cb[type] = NULL; handle->user_data[type] = NULL; - LOGI("[%s] Event type : %d", __FUNCTION__, type); + LOGI("Event type : %d", type); return RADIO_ERROR_NONE; } @@ -157,7 +160,7 @@ static int __msg_callback(int message, void *param, void *user_data) { radio_s *handle = (radio_s *)user_data; MMMessageParamType *msg = (MMMessageParamType *)param; - LOGI("[%s] Got message type : 0x%x", __FUNCTION__, message); + LOGI("Got message type : 0x%x", message); switch (message) { case MM_MESSAGE_RADIO_SCAN_INFO: if (handle->user_cb[_RADIO_EVENT_TYPE_SCAN_INFO]) @@ -192,14 +195,14 @@ static int __msg_callback(int message, void *param, void *user_data) __convert_error_code(msg->code, (char *)__FUNCTION__); break; case MM_MESSAGE_RADIO_SCAN_START: - LOGI("[%s] Scan Started", __FUNCTION__); + LOGI("Scan Started"); break; case MM_MESSAGE_STATE_CHANGED: handle->state = __convert_radio_state(msg->state.current); - LOGI("[%s] State Changed --- from : %d , to : %d", __FUNCTION__, __convert_radio_state(msg->state.previous), handle->state); + LOGI("State Changed --- from : %d , to : %d", __convert_radio_state(msg->state.previous), handle->state); break; case MM_MESSAGE_RADIO_SEEK_START: - LOGI("[%s] Seek Started", __FUNCTION__); + LOGI("Seek Started"); break; default: break; @@ -209,22 +212,22 @@ static int __msg_callback(int message, void *param, void *user_data) static int __radio_check_system_info_feature_supported() { - bool bValue = false; - int nRetVal = false; + bool val = false; + int ret = false; - nRetVal = system_info_get_platform_bool("http://tizen.org/feature/fmradio", &bValue); + ret = system_info_get_platform_bool("http://tizen.org/feature/fmradio", &val); - if (nRetVal != SYSTEM_INFO_ERROR_NONE) { - LOGE("[%s] SYSTEM_INFO_ERROR : ", __FUNCTION__); + if (ret != SYSTEM_INFO_ERROR_NONE) { + LOGE("SYSTEM_INFO_ERROR"); return false; } - if (false == bValue) - LOGI("system_info_get_platform_bool returned Unsupported feature capability\n"); + if (val == false) + LOGI("system_info_get_platform_bool returned Unsupported feature capability"); else - LOGI("system_info_get_platform_bool returned Supported status feature\n"); + LOGI("system_info_get_platform_bool returned Supported status feature"); - return bValue; + return val; } /* @@ -232,44 +235,45 @@ static int __radio_check_system_info_feature_supported() */ int radio_create(radio_h *radio) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); radio_s *handle; handle = (radio_s *)malloc(sizeof(radio_s)); - if (handle != NULL) { - memset(handle, 0, sizeof(radio_s)); - } else { - LOGE("[%s] RADIO_ERROR_OUT_OF_MEMORY(0x%08x)", __FUNCTION__, RADIO_ERROR_OUT_OF_MEMORY); + if (!handle) { + LOGE("RADIO_ERROR_OUT_OF_MEMORY(0x%08x)", RADIO_ERROR_OUT_OF_MEMORY); return RADIO_ERROR_OUT_OF_MEMORY; } + + memset(handle, 0, sizeof(radio_s)); + int ret = mm_radio_create(&handle->mm_handle); if (ret != MM_ERROR_NONE) { free(handle); handle = NULL; return __convert_error_code(ret, (char *)__FUNCTION__); - } else { - *radio = (radio_h)handle; + } + + *radio = (radio_h)handle; - ret = mm_radio_set_message_callback(handle->mm_handle, __msg_callback, (void *)handle); - if (ret != MM_ERROR_NONE) - LOGW("[%s] Failed to set message callback function (0x%x)", __FUNCTION__, ret); + ret = mm_radio_set_message_callback(handle->mm_handle, __msg_callback, (void *)handle); + if (ret != MM_ERROR_NONE) + LOGW("Failed to set message callback function (0x%x)", ret); - ret = mm_radio_realize(handle->mm_handle); - if (ret != MM_ERROR_NONE) - return __convert_error_code(ret, (char *)__FUNCTION__); + ret = mm_radio_realize(handle->mm_handle); + if (ret != MM_ERROR_NONE) + return __convert_error_code(ret, (char *)__FUNCTION__); - handle->state = RADIO_STATE_READY; - handle->mute = false; - handle->seeking = false; - return RADIO_ERROR_NONE; - } + handle->state = RADIO_STATE_READY; + handle->mute = false; + handle->seeking = false; + return RADIO_ERROR_NONE; } int radio_destroy(radio_h radio) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); radio_s *handle = (radio_s *)radio; @@ -277,21 +281,20 @@ int radio_destroy(radio_h radio) int ret; ret = mm_radio_unrealize(handle->mm_handle); if (ret != MM_ERROR_NONE) - LOGW("[%s] Failed to unrealize (0x%x)", __FUNCTION__, ret); + LOGW("Failed to unrealize (0x%x)", ret); ret = mm_radio_destroy(handle->mm_handle); - if (ret != MM_ERROR_NONE) { + if (ret != MM_ERROR_NONE) return __convert_error_code(ret, (char *)__FUNCTION__); - } else { - free(handle); - handle = NULL; - return RADIO_ERROR_NONE; - } + + free(handle); + handle = NULL; + return RADIO_ERROR_NONE; } int radio_get_state(radio_h radio, radio_state_e *state) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); RADIO_NULL_ARG_CHECK(state); @@ -301,50 +304,48 @@ int radio_get_state(radio_h radio, radio_state_e *state) if (ret != MM_ERROR_NONE) { *state = handle->state; return __convert_error_code(ret, (char *)__FUNCTION__); - } else { - handle->state = __convert_radio_state(currentStat); - *state = handle->state; - return RADIO_ERROR_NONE; } + + handle->state = __convert_radio_state(currentStat); + *state = handle->state; + return RADIO_ERROR_NONE; } int radio_start(radio_h radio) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); radio_s *handle = (radio_s *)radio; RADIO_STATE_CHECK(handle, RADIO_STATE_READY); int ret = mm_radio_start(handle->mm_handle); - if (ret != MM_ERROR_NONE) { + if (ret != MM_ERROR_NONE) return __convert_error_code(ret, (char *)__FUNCTION__); - } else { - handle->state = RADIO_STATE_PLAYING; - return RADIO_ERROR_NONE; - } + + handle->state = RADIO_STATE_PLAYING; + return RADIO_ERROR_NONE; } int radio_stop(radio_h radio) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); radio_s *handle = (radio_s *)radio; RADIO_STATE_CHECK(handle, RADIO_STATE_PLAYING); int ret = mm_radio_stop(handle->mm_handle); - if (ret != MM_ERROR_NONE) { + if (ret != MM_ERROR_NONE) return __convert_error_code(ret, (char *)__FUNCTION__); - } else { - handle->state = RADIO_STATE_READY; - return RADIO_ERROR_NONE; - } + + handle->state = RADIO_STATE_READY; + return RADIO_ERROR_NONE; } int radio_seek_up(radio_h radio, radio_seek_completed_cb callback, void *user_data) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); radio_s *handle = (radio_s *)radio; @@ -365,13 +366,13 @@ int radio_seek_up(radio_h radio, radio_seek_completed_cb callback, void *user_da int ret = mm_radio_seek(handle->mm_handle, MM_RADIO_SEEK_UP); if (ret != MM_ERROR_NONE) return __convert_error_code(ret, (char *)__FUNCTION__); - else - return RADIO_ERROR_NONE; + + return RADIO_ERROR_NONE; } int radio_seek_down(radio_h radio, radio_seek_completed_cb callback, void *user_data) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); radio_s *handle = (radio_s *)radio; @@ -392,17 +393,17 @@ int radio_seek_down(radio_h radio, radio_seek_completed_cb callback, void *user_ int ret = mm_radio_seek(handle->mm_handle, MM_RADIO_SEEK_DOWN); if (ret != MM_ERROR_NONE) return __convert_error_code(ret, (char *)__FUNCTION__); - else - return RADIO_ERROR_NONE; + + return RADIO_ERROR_NONE; } int radio_set_frequency(radio_h radio, int frequency) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); if (frequency < 87500 || frequency > 108000) { - LOGE("[%s] RADIO_ERROR_INVALID_PARAMETER(0x%08x) : Out of range (87500 ~ 108000)", __FUNCTION__, RADIO_ERROR_INVALID_PARAMETER); + LOGE("RADIO_ERROR_INVALID_PARAMETER(0x%08x) : Out of range (87500 ~ 108000)", RADIO_ERROR_INVALID_PARAMETER); return RADIO_ERROR_INVALID_PARAMETER; } @@ -410,13 +411,13 @@ int radio_set_frequency(radio_h radio, int frequency) int ret = mm_radio_set_frequency(handle->mm_handle, frequency); if (ret != MM_ERROR_NONE) return __convert_error_code(ret, (char *)__FUNCTION__); - else - return RADIO_ERROR_NONE; + + return RADIO_ERROR_NONE; } int radio_get_frequency(radio_h radio, int *frequency) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); RADIO_NULL_ARG_CHECK(frequency); @@ -424,17 +425,16 @@ int radio_get_frequency(radio_h radio, int *frequency) int freq; int ret = mm_radio_get_frequency(handle->mm_handle, &freq); - if (ret != MM_ERROR_NONE) { + if (ret != MM_ERROR_NONE) return __convert_error_code(ret, (char *)__FUNCTION__); - } else { - *frequency = freq; - return RADIO_ERROR_NONE; - } + + *frequency = freq; + return RADIO_ERROR_NONE; } int radio_get_signal_strength(radio_h radio, int *strength) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); RADIO_NULL_ARG_CHECK(strength); @@ -442,17 +442,16 @@ int radio_get_signal_strength(radio_h radio, int *strength) int _strength; int ret = mm_radio_get_signal_strength(handle->mm_handle, &_strength); - if (ret != MM_ERROR_NONE) { + if (ret != MM_ERROR_NONE) return __convert_error_code(ret, (char *)__FUNCTION__); - } else { - *strength = _strength; - return RADIO_ERROR_NONE; - } + + *strength = _strength; + return RADIO_ERROR_NONE; } int radio_scan_start(radio_h radio, radio_scan_updated_cb callback, void *user_data) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); radio_s *handle = (radio_s *)radio; @@ -463,24 +462,24 @@ int radio_scan_start(radio_h radio, radio_scan_updated_cb callback, void *user_d __unset_callback(_RADIO_EVENT_TYPE_SCAN_INFO, radio); int ret = mm_radio_scan_start(handle->mm_handle); - if (ret != MM_ERROR_NONE) { + if (ret != MM_ERROR_NONE) return __convert_error_code(ret, (char *)__FUNCTION__); - } else { - handle->state = RADIO_STATE_SCANNING; - return RADIO_ERROR_NONE; - } + + handle->state = RADIO_STATE_SCANNING; + return RADIO_ERROR_NONE; + } int radio_scan_stop(radio_h radio, radio_scan_stopped_cb callback, void *user_data) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); radio_s *handle = (radio_s *)radio; RADIO_STATE_CHECK(handle, RADIO_STATE_SCANNING); if (handle->user_cb[_RADIO_EVENT_TYPE_SCAN_STOP]) { - LOGW("[%s] Failed to stop scan (0x%x)", __FUNCTION__, RADIO_ERROR_INVALID_OPERATION); + LOGW("Failed to stop scan (0x%x)", RADIO_ERROR_INVALID_OPERATION); return RADIO_ERROR_INVALID_OPERATION; } @@ -492,29 +491,29 @@ int radio_scan_stop(radio_h radio, radio_scan_stopped_cb callback, void *user_da int ret = mm_radio_scan_stop(handle->mm_handle); if (ret != MM_ERROR_NONE) return __convert_error_code(ret, (char *)__FUNCTION__); - else - return RADIO_ERROR_NONE; + + return RADIO_ERROR_NONE; } int radio_set_mute(radio_h radio, bool muted) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); radio_s *handle = (radio_s *)radio; int ret = mm_radio_set_mute(handle->mm_handle, muted); - if (ret != MM_ERROR_NONE) { + if (ret != MM_ERROR_NONE) return __convert_error_code(ret, (char *)__FUNCTION__); - } else { - handle->mute = muted; - return RADIO_ERROR_NONE; - } + + handle->mute = muted; + return RADIO_ERROR_NONE; + } int radio_is_muted(radio_h radio, bool *muted) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); RADIO_NULL_ARG_CHECK(muted); @@ -525,35 +524,35 @@ int radio_is_muted(radio_h radio, bool *muted) int radio_set_scan_completed_cb(radio_h radio, radio_scan_completed_cb callback, void *user_data) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); return __set_callback(_RADIO_EVENT_TYPE_SCAN_FINISH, radio, callback, user_data); } int radio_unset_scan_completed_cb(radio_h radio) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); return __unset_callback(_RADIO_EVENT_TYPE_SCAN_FINISH, radio); } int radio_set_interrupted_cb(radio_h radio, radio_interrupted_cb callback, void *user_data) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); return __set_callback(_RADIO_EVENT_TYPE_INTERRUPT, radio, callback, user_data); } int radio_unset_interrupted_cb(radio_h radio) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); return __unset_callback(_RADIO_EVENT_TYPE_INTERRUPT, radio); } int radio_get_frequency_range(radio_h radio, int *min_freq, int *max_freq) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); RADIO_NULL_ARG_CHECK(min_freq); @@ -564,38 +563,36 @@ int radio_get_frequency_range(radio_h radio, int *min_freq, int *max_freq) unsigned int max = 0; int ret = mm_radio_get_region_frequency_range(handle->mm_handle, &min, &max); - if (ret != MM_ERROR_NONE) { + if (ret != MM_ERROR_NONE) return __convert_error_code(ret, (char *)__FUNCTION__); - } else { - *min_freq = min; - *max_freq = max; - return RADIO_ERROR_NONE; - } + + *min_freq = min; + *max_freq = max; + return RADIO_ERROR_NONE; } int radio_get_channel_spacing(radio_h radio, int *channel_spacing) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); radio_s *handle = (radio_s *)radio; int ret = mm_radio_get_channel_spacing(handle->mm_handle, channel_spacing); - if (ret != MM_ERROR_NONE) return __convert_error_code(ret, (char *)__FUNCTION__); - else - return RADIO_ERROR_NONE; + + return RADIO_ERROR_NONE; } int radio_set_volume(radio_h radio, float volume) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); if (volume < 0.0 || volume > 1.0) { - LOGE("[%s] RADIO_ERROR_INVALID_PARAMETER(0x%08x) : Out of range (0.0 ~ 1.0)", __FUNCTION__, RADIO_ERROR_INVALID_PARAMETER); + LOGE("RADIO_ERROR_INVALID_PARAMETER(0x%08x) : Out of range (0.0 ~ 1.0)", RADIO_ERROR_INVALID_PARAMETER); return RADIO_ERROR_INVALID_PARAMETER; } @@ -603,13 +600,13 @@ int radio_set_volume(radio_h radio, float volume) int ret = mm_radio_set_volume(handle->mm_handle, volume); if (ret != MM_ERROR_NONE) return __convert_error_code(ret, (char *)__FUNCTION__); - else - return RADIO_ERROR_NONE; + + return RADIO_ERROR_NONE; } int radio_get_volume(radio_h radio, float *volume) { - LOGI("[%s] Enter", __func__); + LOGI("Enter"); RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported()); RADIO_INSTANCE_CHECK(radio); RADIO_NULL_ARG_CHECK(volume); @@ -617,11 +614,9 @@ int radio_get_volume(radio_h radio, float *volume) float vol; int ret = mm_radio_get_volume(handle->mm_handle, &vol); - if (ret != MM_ERROR_NONE) { + if (ret != MM_ERROR_NONE) return __convert_error_code(ret, (char *)__FUNCTION__); - } else { - *volume = vol; - return RADIO_ERROR_NONE; - } -} + *volume = vol; + return RADIO_ERROR_NONE; +} diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/test/radio_test.c b/test/radio_test.c old mode 100755 new mode 100644 diff --git a/test/radio_test_type.h b/test/radio_test_type.h old mode 100755 new mode 100644