[Mesa-dev] [PATCH] egl/dri2: Do not need to check return value from mtx_lock
Dongwon Kim
dongwon.kim at intel.com
Thu Jul 28 21:38:35 UTC 2016
This removes unnecessary error checks on return result of mtx_lock
calls as in all other places in MESA source since there is no chance
that mtx_lock returns any of error codes in current implementation.
Signed-off-by: Dongwon Kim <dongwon.kim at intel.com>
---
src/egl/drivers/dri2/egl_dri2.c | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index ac2be86..26b80d4 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -2578,10 +2578,7 @@ dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
/* if timeout is EGL_FOREVER_KHR, it should wait without any timeout.*/
if (timeout == EGL_FOREVER_KHR) {
- if (mtx_lock(&dri2_sync->mutex)) {
- ret = EGL_FALSE;
- goto cleanup;
- }
+ mtx_lock(&dri2_sync->mutex);
ret = cnd_wait(&dri2_sync->cond, &dri2_sync->mutex);
@@ -2609,10 +2606,7 @@ dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
expire.nsec -= 1000000000L;
}
- if (mtx_lock(&dri2_sync->mutex)) {
- ret = EGL_FALSE;
- goto cleanup;
- }
+ mtx_lock(&dri2_sync->mutex);
ret = cnd_timedwait(&dri2_sync->cond, &dri2_sync->mutex, &expire);
@@ -2632,15 +2626,12 @@ dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
break;
}
- cleanup:
- dri2_egl_unref_sync(dri2_dpy, dri2_sync);
+ dri2_egl_unref_sync(dri2_dpy, dri2_sync);
- if (ret == EGL_FALSE) {
- _eglError(EGL_BAD_ACCESS, "eglClientWaitSyncKHR");
- return EGL_FALSE;
- }
+ if (ret == EGL_FALSE)
+ _eglError(EGL_BAD_ACCESS, "eglClientWaitSyncKHR");
- return ret;
+ return ret;
}
static EGLBoolean
--
2.7.4
More information about the mesa-dev
mailing list