From d863e62b32bc155ae663fc90bae0139fa524a4e0 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 30 Oct 2021 14:08:36 -0700 Subject: [PATCH] intel/compiler: Change selected_simd return type to int. brw_simd_select return type is int. Fix defect reported by Coverity Scan. Unsigned compared against 0 (NO_EFFECT) unsigned_compare: This less-than-zero comparison of an unsigned value is never true. selected_simd < 0U. Fixes: 7dda0cf2b8e ("intel/compiler: Use SIMD selection helpers for CS") Signed-off-by: Vinson Lee Reviewed-by: Caio Marcelo de Oliveira Filho Part-of: --- src/intel/compiler/brw_fs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index ccd2f039340..3b9ed9469bc 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -10146,7 +10146,7 @@ brw_compile_cs(const struct brw_compiler *compiler, } } - const unsigned selected_simd = brw_simd_select(prog_data); + const int selected_simd = brw_simd_select(prog_data); if (selected_simd < 0) { params->error_str = ralloc_asprintf(mem_ctx, "Can't compile shader: %s, %s and %s.\n", error[0], error[1], error[2]);;