On Apr 17, 2016 1:56 PM, "Dave Airlie" <[email protected]> wrote:
>
> From: Dave Airlie <[email protected]>
>
> Pointed out by coverity.
>
> Signed-off-by: Dave Airlie <[email protected]>
> ---
>  src/compiler/nir/nir_builder.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/compiler/nir/nir_builder.h
b/src/compiler/nir/nir_builder.h
> index 29b13fb..1425dba 100644
> --- a/src/compiler/nir/nir_builder.h
> +++ b/src/compiler/nir/nir_builder.h
> @@ -79,10 +79,10 @@ nir_ssa_undef(nir_builder *build, unsigned
num_components, unsigned bit_size)
>  {
>     nir_ssa_undef_instr *undef =
>        nir_ssa_undef_instr_create(build->shader, num_components,
bit_size);
> -   undef->def.bit_size = bit_size;
>     if (!undef)
>        return NULL;
>
> +   undef->def.bit_size = bit_size;

You can just can this line instead.  We just passed bit_size into the
constructor function.

>     nir_instr_insert(nir_before_cf_list(&build->impl->body),
&undef->instr);
>
>     return &undef->def;
> --
> 2.5.5
>
> _______________________________________________
> mesa-dev mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to