<div dir="ltr"><div><div>Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>><br><br></div>Note that this is not meant for master, because master doesn't need this fix anymore.<br><br></div>Marek<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 13, 2017 at 12:07 AM, Mauro Rossi <span dir="ltr"><<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">'if (regs->counters)' expression at line 623 is always true,<br>
spotted because of an error when building android-x86.<br>
<br>
'if (regs->counters[idx])' is used instead.<br>
<br>
Fixes the following building error in Android:<br>
<br>
external/mesa/src/gallium/<wbr>drivers/radeonsi/si_<wbr>perfcounter.c:617:14:<br>
error: address of array 'regs->counters' will always evaluate to 'true' [-Werror,-Wpointer-bool-<wbr>conversion]<br>
                        if (regs->counters)<br>
                        ~~  ~~~~~~^~~~~~~~<br>
<br>
Fixes: ad22006 "radeonsi: implement AMD_performance_monitor for CIK+"<br>
---<br>
 src/gallium/drivers/radeonsi/<wbr>si_perfcounter.c | 2 +-<br>
 1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/src/gallium/drivers/<wbr>radeonsi/si_perfcounter.c b/src/gallium/drivers/<wbr>radeonsi/si_perfcounter.c<br>
index 41dd52edb1..85b6e5c55a 100644<br>
--- a/src/gallium/drivers/<wbr>radeonsi/si_perfcounter.c<br>
+++ b/src/gallium/drivers/<wbr>radeonsi/si_perfcounter.c<br>
@@ -620,7 +620,7 @@ static void si_pc_emit_read(struct r600_common_context *ctx,<br>
                        reg_delta = -reg_delta;<br>
<br>
                for (idx = 0; idx < count; ++idx) {<br>
-                       if (regs->counters)<br>
+                       if (regs->counters[idx])<br>
                                reg = regs->counters[idx];<br>
<br>
                        radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>