From 08f7d37fb97712e377f0b788be99bd10f899fa79 Mon Sep 17 00:00:00 2001 From: "Thomas H.P. Andersen" Date: Thu, 23 Dec 2021 16:15:00 +0100 Subject: [PATCH] panvk: cast negative value to unint8_t The index is a uint8_t but can be assigned a negative 1 value in panvk_pipeline_builder_parse_color_blend() The comparison to ~0 thus makes sense but clang will complain: "result of comparison of constant -1 with expression of type 'const uint8_t' (aka 'const unsigned char') is always true [-Wtautological-constant-out-of-range-compare]" Fix this by casting to a uint8_t before comparison. Fixes a warning with clang Reviewed-by: Emma Anholt Part-of: --- src/panfrost/vulkan/panvk_vX_cmd_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/vulkan/panvk_vX_cmd_buffer.c b/src/panfrost/vulkan/panvk_vX_cmd_buffer.c index a08f428a2ae..5eaf7e49cf7 100644 --- a/src/panfrost/vulkan/panvk_vX_cmd_buffer.c +++ b/src/panfrost/vulkan/panvk_vX_cmd_buffer.c @@ -468,7 +468,7 @@ panvk_draw_prepare_fs_rsd(struct panvk_cmd_buffer *cmdbuf, void *bd = rsd.cpu + pan_size(RENDERER_STATE); for (unsigned i = 0; i < pipeline->blend.state.rt_count; i++) { - if (pipeline->blend.constant[i].index != ~0) { + if (pipeline->blend.constant[i].index != (uint8_t)~0) { struct mali_blend_packed bd_dyn; struct mali_blend_packed *bd_templ = (struct mali_blend_packed *)&pipeline->blend.bd_template[i];