v3dv: Remove unsigned comparison to zero.
authorVinson Lee <vlee@freedesktop.org>
Wed, 14 Oct 2020 23:25:31 +0000 (16:25 -0700)
committerVinson Lee <vlee@freedesktop.org>
Fri, 16 Oct 2020 22:25:37 +0000 (15:25 -0700)
index is of type uint32_t.

Fix defect reported by Coverity Scan.

Macro compares unsigned to 0 (NO_EFFECT)
unsigned_compare: This greater-than-or-equal-to-zero comparison of
an unsigned value is always true. index >= 0U.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7153>

src/broadcom/vulkan/v3dv_descriptor_set.c

index 41754bd..89657ce 100644 (file)
@@ -88,7 +88,7 @@ v3dv_descriptor_map_get_descriptor(struct v3dv_descriptor_state *descriptor_stat
                                    uint32_t index,
                                    uint32_t *dynamic_offset)
 {
-   assert(index >= 0 && index < map->num_desc);
+   assert(index < map->num_desc);
 
    uint32_t set_number = map->set[index];
    assert((descriptor_state->valid & 1 << set_number));