[Mesa-dev] [PATCH] freedreno: freedreno_fence: Simplify the return code logic

Fabio Estevam festevam at gmail.com
Sat Apr 22 16:33:13 UTC 2017


The return code can be simplified by using the logical not operator.

Signed-off-by: Fabio Estevam <festevam at gmail.com>
---
 src/gallium/drivers/freedreno/freedreno_fence.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_fence.c b/src/gallium/drivers/freedreno/freedreno_fence.c
index f20c6ac..a4cdc3e 100644
--- a/src/gallium/drivers/freedreno/freedreno_fence.c
+++ b/src/gallium/drivers/freedreno/freedreno_fence.c
@@ -64,10 +64,8 @@ boolean fd_fence_finish(struct pipe_screen *pscreen,
 		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 (fd_pipe_wait_timeout(fence->screen->pipe, fence->timestamp, timeout))
 		return false;
-- 
2.7.4



More information about the mesa-dev mailing list