radv: fix Coverity no effect control flow issue
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 6 Jun 2018 23:49:37 +0000 (09:49 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 7 Jun 2018 00:10:57 +0000 (10:10 +1000)
swizzle is unsigned so "desc->swizzle[c] < 0" is never true.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_formats.c

index 50ec904d514b7f0b8295212733f23470a02c58e1..958f2a2c821f0e7e1fe8063b4dbd5bd0697e4d74 100644 (file)
@@ -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]];