[Mesa-dev] [PATCH] radv: fix Coverity no effect control flow issue

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Wed Jun 6 23:53:38 UTC 2018


Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

On Thu, Jun 7, 2018 at 1:49 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> swizzle is unsigned so "desc->swizzle[c] < 0" is never true.
> ---
>  src/amd/vulkan/radv_formats.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c
> index 50ec904d514..958f2a2c821 100644
> --- a/src/amd/vulkan/radv_formats.c
> +++ b/src/amd/vulkan/radv_formats.c
> @@ -921,7 +921,7 @@ bool radv_format_pack_clear_color(VkFormat format,
>         uint64_t clear_val = 0;
>
>         for (unsigned c = 0; c < 4; ++c) {
> -               if (desc->swizzle[c] < 0 || desc->swizzle[c] >= 4)
> +               if (desc->swizzle[c] >= 4)
>                         continue;
>
>                 const struct vk_format_channel_description *channel = &desc->channel[desc->swizzle[c]];
> --
> 2.17.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list