From: Emil Velikov <[email protected]>

If the specific initialize was successfull, dri2_egl_display() will
return a non NULL pointer. Thus we can drop the check and flatten the
codeflow.

Signed-off-by: Emil Velikov <[email protected]>
---
 src/egl/drivers/dri2/egl_dri2.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 83545bab227..02c187e5fe7 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -905,17 +905,13 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
       return EGL_FALSE;
    }
 
-   if (ret) {
-      dri2_dpy = dri2_egl_display(disp);
-
-      if (!dri2_dpy) {
-         return EGL_FALSE;
-      }
+   if (!ret)
+      return EGL_FALSE;
 
-      dri2_dpy->ref_count++;
-   }
+   dri2_dpy = dri2_egl_display(disp);
+   dri2_dpy->ref_count++;
 
-   return ret;
+   return EGL_TRUE;
 }
 
 /**
-- 
2.14.0

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to