use type casting
authorJunkyeong Kim <jk0430.kim@samsung.com>
Tue, 2 Feb 2021 12:00:24 +0000 (21:00 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Tue, 2 Feb 2021 12:00:27 +0000 (21:00 +0900)
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
src/tdm.c

index 3200e26..c3bce47 100644 (file)
--- a/src/tdm.c
+++ b/src/tdm.c
@@ -689,7 +689,6 @@ _tdm_display_get_ordered_outputs(tdm_private_module *private_module, int *count)
        int i, output_count = 0, output_connected_count = 0;
        int index_dsi = 0, index_lvds = 0, index_hdmia = 0, index_hdmib = 0;
        tdm_error ret;
-       hal_tdm_error hret;
 
        /* don't change list order if not init time */
        if (private_module->outputs) {
@@ -697,15 +696,12 @@ _tdm_display_get_ordered_outputs(tdm_private_module *private_module, int *count)
                return private_module->outputs;
        }
 
-       if (private_module->use_hal_tdm) {
-               outputs = (tdm_output **)hal_tdm_display_get_outputs(NULL, &output_count, &hret);
-               if (hret != HAL_TDM_ERROR_NONE)
-                       goto no_output;
-       } else {
+       if (private_module->use_hal_tdm)
+               outputs = (tdm_output **)hal_tdm_display_get_outputs(NULL, &output_count, (hal_tdm_error *)&ret);
+       else
                outputs = func_display->display_get_outputs(private_module->bdata, &output_count, &ret);
-               if (ret != TDM_ERROR_NONE)
-                       goto no_output;
-       }
+       if (ret != TDM_ERROR_NONE)
+               goto no_output;
 
        *count = output_count;
 
@@ -722,18 +718,13 @@ _tdm_display_get_ordered_outputs(tdm_private_module *private_module, int *count)
                tdm_caps_output caps;
                memset(&caps, 0, sizeof(tdm_caps_output));
 
-               if (private_module->use_hal_tdm) {
-                       hret = hal_tdm_output_get_capability(outputs[i], (hal_tdm_caps_output *)&caps);
-                       if (hret != HAL_TDM_ERROR_NONE) {
-                               TDM_ERR("output_get_capability() failed");
-                               goto no_output;
-                       }
-               } else {
+               if (private_module->use_hal_tdm)
+                       ret = (tdm_error)hal_tdm_output_get_capability(outputs[i], (hal_tdm_caps_output *)&caps);
+               else
                        ret = func_output->output_get_capability(outputs[i], &caps);
-                       if (ret != TDM_ERROR_NONE) {
-                               TDM_ERR("output_get_capability() failed");
-                               goto no_output;
-                       }
+               if (ret != TDM_ERROR_NONE) {
+                       TDM_ERR("output_get_capability() failed");
+                       goto no_output;
                }
 
                if (caps.status == TDM_OUTPUT_CONN_STATUS_CONNECTED) {