From 253274351f550c428ca4f4f21d9b176579f002ee Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Mon, 15 Aug 2016 15:51:20 +0100 Subject: [PATCH] i965: remove unnecessary `if` if (x) return true; else return false; can be simplified as: return x; since both `x` are already boolean expressions. Signed-off-by: Eric Engestrom Reviewed-by: Chris Wilson Reviewed-by: Emil Velikov --- src/mesa/drivers/dri/i965/intel_screen.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 9df888df448..78766524e3c 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -603,13 +603,9 @@ intel_query_image(__DRIimage *image, int attrib, int *value) *value = image->planar_format->components; return true; case __DRI_IMAGE_ATTRIB_FD: - if (drm_intel_bo_gem_export_to_prime(image->bo, value) == 0) - return true; - return false; + return !drm_intel_bo_gem_export_to_prime(image->bo, value); case __DRI_IMAGE_ATTRIB_FOURCC: - if (intel_lookup_fourcc(image->dri_format, value)) - return true; - return false; + return intel_lookup_fourcc(image->dri_format, value); case __DRI_IMAGE_ATTRIB_NUM_PLANES: *value = 1; return true; -- 2.30.2