[Mesa-dev] [PATCH] anv: Silence a bunch of unused variable warnings.
Bas Nieuwenhuizen
bas at basnieuwenhuizen.nl
Mon Oct 1 19:06:10 UTC 2018
On Mon, Oct 1, 2018 at 8:04 AM Tapani Pälli <tapani.palli at intel.com> wrote:
>
> maybe also move the declaration of ret closer to the actual usage in
> anv_wait_for_bo_fences?
Done.
>
> Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
Thanks!
>
> On 9/30/18 9:12 PM, Bas Nieuwenhuizen wrote:
> > All three are only used in asserts, so this silences release build
> > warnings.
> > ---
> > src/intel/vulkan/anv_blorp.c | 3 ++-
> > src/intel/vulkan/anv_queue.c | 2 +-
> > src/intel/vulkan/genX_cmd_buffer.c | 2 +-
> > 3 files changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c
> > index a1c359cf461..df535270241 100644
> > --- a/src/intel/vulkan/anv_blorp.c
> > +++ b/src/intel/vulkan/anv_blorp.c
> > @@ -1269,7 +1269,8 @@ void anv_CmdResolveImage(
> > const uint32_t layer_count =
> > anv_get_layerCount(dst_image, &pRegions[r].dstSubresource);
> >
> > - VkImageAspectFlags src_mask = pRegions[r].srcSubresource.aspectMask,
> > + MAYBE_UNUSED VkImageAspectFlags
> > + src_mask = pRegions[r].srcSubresource.aspectMask,
> > dst_mask = pRegions[r].dstSubresource.aspectMask;
> >
> > assert(anv_image_aspects_compatible(src_mask, dst_mask));
> > diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c
> > index e0c0a42069f..3a1fb40b6a1 100644
> > --- a/src/intel/vulkan/anv_queue.c
> > +++ b/src/intel/vulkan/anv_queue.c
> > @@ -542,7 +542,7 @@ anv_wait_for_bo_fences(struct anv_device *device,
> > bool waitAll,
> > uint64_t _timeout)
> > {
> > - int ret;
> > + MAYBE_UNUSED int ret;
> >
> > /* DRM_IOCTL_I915_GEM_WAIT uses a signed 64 bit timeout and is supposed
> > * to block indefinitely timeouts <= 0. Unfortunately, this was broken
> > diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
> > index 099c30f3d66..d672f41d18b 100644
> > --- a/src/intel/vulkan/genX_cmd_buffer.c
> > +++ b/src/intel/vulkan/genX_cmd_buffer.c
> > @@ -931,7 +931,7 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer,
> > assert(level_count != VK_REMAINING_MIP_LEVELS &&
> > layer_count != VK_REMAINING_ARRAY_LAYERS);
> > /* Ensure the subresource range is valid. */
> > - uint64_t last_level_num = base_level + level_count;
> > + MAYBE_UNUSED uint64_t last_level_num = base_level + level_count;
> > const uint32_t max_depth = anv_minify(image->extent.depth, base_level);
> > UNUSED const uint32_t image_layers = MAX2(image->array_size, max_depth);
> > assert((uint64_t)base_layer + layer_count <= image_layers);
> >
More information about the mesa-dev
mailing list