cfg is only used inside for loop so also move declaration there. Fixes "Unused pointer value" defect reported by Coverity.
Signed-off-by: Vinson Lee <v...@freedesktop.org> --- src/gallium/drivers/nouveau/nvc0/nvc0_query.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c index 21aa358..4f83f57 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c @@ -1155,9 +1155,6 @@ nvc0_mp_pm_query_end(struct nvc0_context *nvc0, struct nvc0_query *q) const uint block[3] = { 32, is_nve4 ? 4 : 1, 1 }; const uint grid[3] = { screen->mp_count, 1, 1 }; unsigned c; - const struct nvc0_mp_pm_query_cfg *cfg; - - cfg = nvc0_mp_pm_query_get_cfg(nvc0, q); if (unlikely(!screen->pm.prog)) { struct nvc0_program *prog = CALLOC_STRUCT(nvc0_program); @@ -1212,6 +1209,7 @@ nvc0_mp_pm_query_end(struct nvc0_context *nvc0, struct nvc0_query *q) mask = 0; for (c = 0; c < 8; ++c) { unsigned i; + const struct nvc0_mp_pm_query_cfg *cfg; q = nvc0_query(screen->pm.mp_counter[c]); if (!q) continue; -- 1.8.3.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev