radeonsi: silence a coverity warning
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 23 Mar 2016 16:58:28 +0000 (11:58 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 24 Mar 2016 17:23:14 +0000 (12:23 -0500)
The following Coverity warning

5378      tmpl.fetch_args = atomic_fetch_args;
5379      tmpl.emit = atomic_emit;
>>>     CID 1357115:  Uninitialized variables  (UNINIT)
>>>     Using uninitialized value "tmpl". Field "tmpl.intr_name" is uninitialized.
5380      bld_base->op_actions[TGSI_OPCODE_ATOMUADD] = tmpl;
5381      bld_base->op_actions[TGSI_OPCODE_ATOMUADD].intr_name = "add";

... is a false positive, but what the hell. This change should "fix" it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index 1e4bf828ae425a679a1fc290bd5d6d717b83a28b..9eb531f8d80dca359556ce778c18ed1396ce0c09 100644 (file)
@@ -5362,7 +5362,7 @@ static void si_init_shader_ctx(struct si_shader_context *ctx,
                               LLVMTargetMachineRef tm)
 {
        struct lp_build_tgsi_context *bld_base;
-       struct lp_build_tgsi_action tmpl;
+       struct lp_build_tgsi_action tmpl = {};
 
        memset(ctx, 0, sizeof(*ctx));
        radeon_llvm_context_init(&ctx->radeon_bld, "amdgcn--");