vc4: Clean up release build warnings using MAYBE_UNUSED.
authorEric Anholt <eric@anholt.net>
Mon, 6 Feb 2017 22:48:45 +0000 (14:48 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 20 Jun 2017 16:09:09 +0000 (09:09 -0700)
These variables are all used in an assert(), so release builds see no
usages.

src/gallium/drivers/vc4/vc4_program.c
src/gallium/drivers/vc4/vc4_qpu_emit.c

index f1c40c06a0e5578756aca7f0ba300c2fcd814eca..60eb68e847b03a5f480d7bf1a3c74d7a62af208e 100644 (file)
@@ -1708,8 +1708,7 @@ ntq_emit_ssa_undef(struct vc4_compile *c, nir_ssa_undef_instr *instr)
 static void
 ntq_emit_color_read(struct vc4_compile *c, nir_intrinsic_instr *instr)
 {
-        nir_const_value *const_offset = nir_src_as_const_value(instr->src[0]);
-        assert(const_offset->u32[0] == 0);
+        assert(nir_src_as_const_value(instr->src[0])->u32[0] == 0);
 
         /* Reads of the per-sample color need to be done in
          * order.
index aaa3a0412160e70db2083fa437642e21f83b4646..cd9a4985d35a2d951eefd338200cef12711e1a23 100644 (file)
@@ -204,9 +204,9 @@ fixup_raddr_conflict(struct qblock *block,
 static void
 set_last_dst_pack(struct qblock *block, struct qinst *inst)
 {
-        bool had_pm = *last_inst(block) & QPU_PM;
-        bool had_ws = *last_inst(block) & QPU_WS;
-        uint32_t unpack = QPU_GET_FIELD(*last_inst(block), QPU_UNPACK);
+        MAYBE_UNUSED bool had_pm = *last_inst(block) & QPU_PM;
+        MAYBE_UNUSED bool had_ws = *last_inst(block) & QPU_WS;
+        MAYBE_UNUSED uint32_t unpack = QPU_GET_FIELD(*last_inst(block), QPU_UNPACK);
 
         if (!inst->dst.pack)
                 return;
@@ -419,7 +419,7 @@ vc4_generate_code_block(struct vc4_compile *c,
                         break;
                 }
 
-                bool handled_qinst_cond = false;
+                MAYBE_UNUSED bool handled_qinst_cond = false;
 
                 switch (qinst->op) {
                 case QOP_RCP: