discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e95488ded57f71b552efdf17a8a77a4208a97185

commit e95488ded57f71b552efdf17a8a77a4208a97185
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Thu Apr 23 13:21:32 2015 -0400

    ecore-drm: refactor _ecore_drm_output_backlight_init() to use fewer gotos
---
 src/lib/ecore_drm/ecore_drm_output.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/src/lib/ecore_drm/ecore_drm_output.c 
b/src/lib/ecore_drm/ecore_drm_output.c
index 9699e98..dbcd088 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -352,27 +352,24 @@ _ecore_drm_output_backlight_init(Ecore_Drm_Output 
*output, uint32_t conn_type)
         else if (!strcmp(devtype, "firmware"))
           type = ECORE_DRM_BACKLIGHT_FIRMWARE;
 
-        if ((conn_type != DRM_MODE_CONNECTOR_LVDS) && 
-            (conn_type != DRM_MODE_CONNECTOR_eDP))
-          {
-             if (type != ECORE_DRM_BACKLIGHT_RAW) goto cont;
-          }
+        if ((conn_type == DRM_MODE_CONNECTOR_LVDS) ||
+            (conn_type == DRM_MODE_CONNECTOR_eDP) ||
+            (type == ECORE_DRM_BACKLIGHT_RAW))
+          found = EINA_TRUE;
 
-        found = EINA_TRUE;
-cont:
         eina_stringshare_del(devtype);
         if (found) break;
      }
 
-   if (!found) goto out;
-
-   if ((backlight = calloc(1, sizeof(Ecore_Drm_Backlight))))
+   if (found)
      {
-        backlight->type = type;
-        backlight->device = eina_stringshare_add(device);
+        if ((backlight = calloc(1, sizeof(Ecore_Drm_Backlight))))
+          {
+             backlight->type = type;
+             backlight->device = eina_stringshare_add(device);
+          }
      }
 
-out:
    EINA_LIST_FREE(devs, device)
      eina_stringshare_del(device);
 

-- 


Reply via email to