i965: remove unnecessary `if`
authorEric Engestrom <eric.engestrom@imgtec.com>
Mon, 15 Aug 2016 14:51:20 +0000 (15:51 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 24 Aug 2016 10:17:05 +0000 (11:17 +0100)
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 <eric.engestrom@imgtec.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/mesa/drivers/dri/i965/intel_screen.c

index 9df888df4483c4a2f8cbd5cd98dab45068f0c87a..78766524e3c985e777ab69e2e11ba284a2799e6f 100644 (file)
@@ -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;