From d74554b16742c29b388ada91d2b8922504153bd2 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 24 Jun 2020 09:06:50 -0700 Subject: [PATCH] freedreno: make foreach_bit() declare it's cursor Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/a5xx/fd5_compute.c | 2 +- src/gallium/drivers/freedreno/a6xx/fd6_compute.c | 2 +- src/gallium/drivers/freedreno/a6xx/fd6_draw.c | 1 - src/gallium/drivers/freedreno/freedreno_draw.c | 1 - src/gallium/drivers/freedreno/freedreno_util.h | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_compute.c b/src/gallium/drivers/freedreno/a5xx/fd5_compute.c index 468070770db..d30188d1e69 100644 --- a/src/gallium/drivers/freedreno/a5xx/fd5_compute.c +++ b/src/gallium/drivers/freedreno/a5xx/fd5_compute.c @@ -184,7 +184,7 @@ fd5_launch_grid(struct fd_context *ctx, const struct pipe_grid_info *info) struct ir3_shader_key key = {}; struct ir3_shader_variant *v; struct fd_ringbuffer *ring = ctx->batch->draw; - unsigned i, nglobal = 0; + unsigned nglobal = 0; emit_setup(ctx); diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_compute.c b/src/gallium/drivers/freedreno/a6xx/fd6_compute.c index b32d24b74e2..27ce7e2a29a 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_compute.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_compute.c @@ -130,7 +130,7 @@ fd6_launch_grid(struct fd_context *ctx, const struct pipe_grid_info *info) struct ir3_shader_key key = {}; struct ir3_shader_variant *v; struct fd_ringbuffer *ring = ctx->batch->draw; - unsigned i, nglobal = 0; + unsigned nglobal = 0; fd6_emit_restore(ctx->batch, ring); diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c index f8b87b76f13..e2b384d4cb1 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c @@ -466,7 +466,6 @@ fd6_clear(struct fd_context *ctx, unsigned buffers, struct pipe_framebuffer_state *pfb = &ctx->batch->framebuffer; const bool has_depth = pfb->zsbuf; unsigned color_buffers = buffers >> 2; - unsigned i; /* If we're clearing after draws, fallback to 3D pipe clears. We could * use blitter clears in the draw batch but then we'd have to patch up the diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c index 5378e598047..e11c07b3df6 100644 --- a/src/gallium/drivers/freedreno/freedreno_draw.c +++ b/src/gallium/drivers/freedreno/freedreno_draw.c @@ -430,7 +430,6 @@ fd_launch_grid(struct pipe_context *pctx, const struct pipe_grid_info *info) struct fd_context *ctx = fd_context(pctx); const struct fd_shaderbuf_stateobj *so = &ctx->shaderbuf[PIPE_SHADER_COMPUTE]; struct fd_batch *batch, *save_batch = NULL; - unsigned i; batch = fd_bc_alloc_batch(&ctx->screen->batch_cache, ctx, true); fd_batch_reference(&save_batch, ctx->batch); diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h index 806f81639b3..33e6f1458de 100644 --- a/src/gallium/drivers/freedreno/freedreno_util.h +++ b/src/gallium/drivers/freedreno/freedreno_util.h @@ -310,7 +310,7 @@ pack_rgba(enum pipe_format format, const float *rgba) do { __typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0) #define foreach_bit(b, mask) \ - for (uint32_t _m = (mask); _m && ({(b) = u_bit_scan(&_m); 1;});) + for (uint32_t _m = (mask), b; _m && ({(b) = u_bit_scan(&_m); (void)(b); 1;});) #define BIT(bit) (1u << bit) -- 2.30.2