etnaviv: etnaviv_fence: Simplify the return code logic
authorFabio Estevam <festevam@gmail.com>
Mon, 17 Apr 2017 22:36:40 +0000 (19:36 -0300)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Sat, 22 Apr 2017 15:48:35 +0000 (17:48 +0200)
The return code can be simplified by using the logical not operator.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
src/gallium/drivers/etnaviv/etnaviv_fence.c

index 65402aaa3bde0bd9c0e0db05adb76ee5f95b0b04..d82708eacbed47e23b451e1a75a5474823282f70 100644 (file)
@@ -65,10 +65,8 @@ static boolean
 etna_screen_fence_finish(struct pipe_screen *pscreen, struct pipe_context *ctx,
                          struct pipe_fence_handle *fence, uint64_t timeout)
 {
-   if (fence->fence_fd != -1) {
-      int ret = sync_wait(fence->fence_fd, timeout / 1000000);
-      return ret == 0;
-   }
+   if (fence->fence_fd != -1)
+       return !sync_wait(fence->fence_fd, timeout / 1000000);
 
    if (etna_pipe_wait_ns(fence->screen->pipe, fence->timestamp, timeout))
       return false;