From: Jason Ekstrand Date: Fri, 25 Oct 2019 21:33:23 +0000 (-0500) Subject: anv: Declare the bo in the anv_block_pool_foreach_bo loop X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c0a4722f292dd437e8a6fa21ef9befb6281bec00;p=mesa.git anv: Declare the bo in the anv_block_pool_foreach_bo loop Reviewed-by: Lionel Landwerlin --- diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index 75f47744497..aedc5543a6b 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_allocator.c @@ -639,7 +639,7 @@ anv_block_pool_expand_range(struct anv_block_pool *pool, static struct anv_bo * anv_block_pool_get_bo(struct anv_block_pool *pool, int32_t *offset) { - struct anv_bo *bo, *bo_found = NULL; + struct anv_bo *bo_found = NULL; int32_t cur_offset = 0; assert(offset); diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 795dc839d84..5ff58e87b66 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++ b/src/intel/vulkan/anv_batch_chain.c @@ -1394,7 +1394,6 @@ setup_execbuf_for_cmd_buffer(struct anv_execbuf *execbuf, adjust_relocations_from_state_pool(ss_pool, &cmd_buffer->surface_relocs, cmd_buffer->last_ss_pool_center); VkResult result; - struct anv_bo *bo; if (cmd_buffer->device->instance->physicalDevice.use_softpin) { anv_block_pool_foreach_bo(bo, &ss_pool->block_pool) { result = anv_execbuf_add_bo(execbuf, bo, NULL, 0, diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index f3f718a4855..328b3a85d09 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -670,7 +670,7 @@ struct anv_block_state { }; #define anv_block_pool_foreach_bo(bo, pool) \ - for (bo = (pool)->bos; bo != &(pool)->bos[(pool)->nbos]; bo++) + for (struct anv_bo *bo = (pool)->bos; bo != &(pool)->bos[(pool)->nbos]; bo++) #define ANV_MAX_BLOCK_POOL_BOS 20