[Mesa-dev] [PATCH 07/19] i965: Drop unnecessary conditional

Matt Turner mattst88 at gmail.com
Mon Aug 28 21:57:09 UTC 2017


Clang doesn't realize that 0 and 1 are the only possibilities, a thinks
lots of variables might be uninitialized.
---
 src/intel/compiler/brw_eu_validate.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/intel/compiler/brw_eu_validate.c b/src/intel/compiler/brw_eu_validate.c
index 249342fb9d..b24b38170e 100644
--- a/src/intel/compiler/brw_eu_validate.c
+++ b/src/intel/compiler/brw_eu_validate.c
@@ -555,7 +555,7 @@ general_restrictions_on_region_parameters(const struct gen_device_info *devinfo,
 
       if (i == 0) {
          DO_SRC(0);
-      } else if (i == 1) {
+      } else {
          DO_SRC(1);
       }
 #undef DO_SRC
@@ -758,7 +758,7 @@ region_alignment_rules(const struct gen_device_info *devinfo,
 
       if (i == 0) {
          DO_SRC(0);
-      } else if (i == 1) {
+      } else {
          DO_SRC(1);
       }
 #undef DO_SRC
@@ -950,7 +950,7 @@ region_alignment_rules(const struct gen_device_info *devinfo,
 
          if (i == 0) {
             DO_SRC(0);
-         } else if (i == 1) {
+         } else {
             DO_SRC(1);
          }
 #undef DO_SRC
@@ -1011,7 +1011,7 @@ region_alignment_rules(const struct gen_device_info *devinfo,
 
          if (i == 0) {
             DO_SRC(0);
-         } else if (i == 1) {
+         } else {
             DO_SRC(1);
          }
 #undef DO_SRC
-- 
2.13.5



More information about the mesa-dev mailing list