egl: remove unnecessary eglGetProcAddress() fallback
authorEric Engestrom <eric.engestrom@intel.com>
Thu, 10 Jan 2019 16:41:38 +0000 (16:41 +0000)
committerEric Engestrom <eric@engestrom.ch>
Sat, 22 Jun 2019 15:17:42 +0000 (15:17 +0000)
No need to add a function that returns `false` only to be cast into
a pointer, we can just use the existing `return NULL` :)

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/main/egldriver.c
src/egl/main/eglfallbacks.c

index e294c8c5f7d74c882a9c0b6ea06194219912ce4a..4dc46b35e9555f96d4917cb1b03fc1cb8d366544 100644 (file)
@@ -109,7 +109,7 @@ _eglMatchDriver(_EGLDisplay *disp)
 __eglMustCastToProperFunctionPointerType
 _eglGetDriverProc(const char *procname)
 {
-   if (_eglGetDriver())
+   if (_eglGetDriver() && _eglDriver->API.GetProcAddress)
       return _eglDriver->API.GetProcAddress(_eglDriver, procname);
 
    return NULL;
index bf667af1124d22b78ad4ac1bc0498dfbd9d5204d..336ca7aee2e6016b0e1af5c0f551eec66899ff33 100644 (file)
@@ -76,7 +76,6 @@ _eglInitDriverFallbacks(_EGLDriver *drv)
 
    drv->API.WaitClient = (void*) _eglReturnFalse;
    drv->API.WaitNative = (void*) _eglReturnFalse;
-   drv->API.GetProcAddress = (void*) _eglReturnFalse;
 
    drv->API.GetSyncAttrib = _eglGetSyncAttrib;
 }