isl: Fix some tautological-compare warnings
authorBen Widawsky <ben@bwidawsk.net>
Fri, 27 May 2016 04:59:17 +0000 (21:59 -0700)
committerBen Widawsky <ben@bwidawsk.net>
Fri, 27 May 2016 04:59:17 +0000 (21:59 -0700)
Fixes:
isl.c:62:22: warning: self-comparison always evaluates to true [-Wtautological-compare]
    assert(ISL_DEV_GEN(dev) == dev->info->gen);
                      ^~
isl.c:63:33: warning: self-comparison always evaluates to true [-Wtautological-compare]
    assert(ISL_DEV_USE_SEPARATE_STENCIL(dev) == dev->use_separate_stencil);

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/intel/isl/isl.c
src/intel/isl/isl.h

index e4bca1689cffb390a12f5a6e8e5dae461c5f7ad4..77b570df3cd547eb12a579f77e6085d30dc4af94 100644 (file)
@@ -59,8 +59,8 @@ isl_device_init(struct isl_device *dev,
     * device properties at buildtime. Verify that the macros with the device
     * properties chosen during runtime.
     */
-   assert(ISL_DEV_GEN(dev) == dev->info->gen);
-   assert(ISL_DEV_USE_SEPARATE_STENCIL(dev) == dev->use_separate_stencil);
+   ISL_DEV_GEN_SANITIZE(dev);
+   ISL_DEV_USE_SEPARATE_STENCIL_SANITIZE(dev);
 
    /* Did we break hiz or stencil? */
    if (ISL_DEV_USE_SEPARATE_STENCIL(dev))
index daa5428f9f318500bb104cf016ba2a0967607a44..ef862282a2a8bc14a69b9cd7c19c77cd91f6f7d5 100644 (file)
@@ -59,6 +59,10 @@ struct brw_image_param;
  * `gcc -DISL_DEV_GEN(dev)=9 ...`.
  */
 #define ISL_DEV_GEN(__dev) ((__dev)->info->gen)
+#define ISL_DEV_GEN_SANITIZE(__dev)
+#else
+#define ISL_DEV_GEN_SANITIZE(__dev) \
+   (assert(ISL_DEV_GEN(__dev) == (__dev)->info->gen))
 #endif
 
 #ifndef ISL_DEV_IS_HASWELL
@@ -77,6 +81,10 @@ struct brw_image_param;
  * `gcc -DISL_DEV_USE_SEPARATE_STENCIL(dev)=1 ...`.
  */
 #define ISL_DEV_USE_SEPARATE_STENCIL(__dev) ((__dev)->use_separate_stencil)
+#define ISL_DEV_USE_SEPARATE_STENCIL_SANITIZE(__dev)
+#else
+#define ISL_DEV_USE_SEPARATE_STENCIL_SANITIZE(__dev) \
+   (assert(ISL_DEV_USE_SEPARATE_STENCIL(__dev) == (__dev)->use_separate_stencil))
 #endif
 
 /**