From: Emil Velikov Date: Sun, 27 Aug 2017 10:20:26 +0000 (+0100) Subject: egl: simplify refcounting after screen creation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2f76dff65f83a28b335497ab216a8bb71e6c97a2;p=mesa.git egl: simplify refcounting after screen creation 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 Reviewed-by: Tapani Pälli Acked-by: Daniel Stone --- 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; } /**