Dead default in switch 76/258676/2
authorrohit singh <rohit.singh@samsung.com>
Mon, 24 May 2021 05:53:55 +0000 (11:23 +0530)
committerrohit singh <rohit.singh@samsung.com>
Mon, 24 May 2021 11:55:53 +0000 (17:25 +0530)
Issue: The statements in the default case are never executed.

Solution: Removal of the retv statement will solve the issue.

Change-Id: I74cc0d357acbb7bc5ce986ef532f5684b3ab74fa
Signed-off-by: rohit.singh <rohit.singh@samsung.com>
ua-api/product/ua-common-product.c
ua-api/src/ua-common.c
ua-daemon/product/ua-manager-common-product.c
ua-daemon/src/ua-manager-common.c

index 274d80e..bf18a17 100644 (file)
@@ -74,8 +74,6 @@ const char *_uam_product_request_to_str(unsigned int req)
 
 const char *_uam_product_event_to_str(unsigned int event)
 {
-       retv_if(UAM_PRODUCT_EVENT_MAX <= event, NULL);
-
        switch (event) {
        CASE_TO_STR(UAM_PRODUCT_EVENT_TEST)
        default:
index 6a96333..91e756d 100644 (file)
@@ -92,8 +92,6 @@ const char *_uam_request_to_str(unsigned int req)
 
 const char *_uam_event_to_str(unsigned int event)
 {
-       retv_if(UAM_EVENT_MAX <= event, NULL);
-
        switch (event) {
        CASE_TO_STR(UAM_EVENT_USER_ADDED)
        CASE_TO_STR(UAM_EVENT_USER_REMOVED)
@@ -114,6 +112,7 @@ const char *_uam_event_to_str(unsigned int event)
        CASE_TO_STR(UAM_EVENT_SERVICE_REGISTERED)
        CASE_TO_STR(UAM_EVENT_SERVICE_UNREGISTERED)
        CASE_TO_STR(UAM_EVENT_SENSOR_STATUS_CHANGED)
+       CASE_TO_STR(UAM_EVENT_DAEMON_TERMINATED)
        default:
                return "UNKNOWN ERROR";
        }
index 560be22..e004f64 100644 (file)
@@ -78,8 +78,6 @@ const char *_uam_manager_product_request_to_str(unsigned int req)
 
 const char *_uam_manager_product_event_to_str(unsigned int event)
 {
-       retv_if(UAM_PRODUCT_EVENT_MAX <= event, NULL);
-
        switch (event) {
        CASE_TO_STR(UAM_PRODUCT_EVENT_TEST)
        default:
index 8e2622b..0edf391 100644 (file)
@@ -75,8 +75,6 @@ const char *_uam_manager_request_to_str(unsigned int req)
 
 const char *_uam_manager_event_to_str(unsigned int event)
 {
-       retv_if(UAM_EVENT_MAX <= event, NULL);
-
        switch (event) {
        CASE_TO_STR(UAM_EVENT_USER_ADDED)
        CASE_TO_STR(UAM_EVENT_USER_REMOVED)
@@ -97,6 +95,7 @@ const char *_uam_manager_event_to_str(unsigned int event)
        CASE_TO_STR(UAM_EVENT_SERVICE_REGISTERED)
        CASE_TO_STR(UAM_EVENT_SERVICE_UNREGISTERED)
        CASE_TO_STR(UAM_EVENT_SENSOR_STATUS_CHANGED)
+       CASE_TO_STR(UAM_EVENT_DAEMON_TERMINATED)
        default:
                return "UNKNOWN ERROR";
        }