freedreno: Silence compiler warnings about uninit 'layers'
authorEric Anholt <eric@anholt.net>
Fri, 10 May 2019 00:30:35 +0000 (17:30 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 13 May 2019 22:37:01 +0000 (15:37 -0700)
My gcc can't see that the uninitialized value from the PIPE_BUFFER case
isn't used from the !PIPE_BUFFER cases later.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
src/gallium/drivers/freedreno/a4xx/fd4_texture.c
src/gallium/drivers/freedreno/a5xx/fd5_texture.c
src/gallium/drivers/freedreno/a6xx/fd6_texture.c

index 748e08e1f7f6e22eba48fc78f2ba41897080df45..306da8de15b9c6cfe2edf4bcb732d730891dbc0d 100644 (file)
@@ -223,7 +223,7 @@ fd4_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
        struct fd4_pipe_sampler_view *so = CALLOC_STRUCT(fd4_pipe_sampler_view);
        struct fd_resource *rsc = fd_resource(prsc);
        enum pipe_format format = cso->format;
-       unsigned lvl, layers;
+       unsigned lvl, layers = 0;
        uint32_t sz2 = 0;
 
        if (!so)
index e8e29d0367a85f319d4c8ea17ca9dfc5ea048071..1ebaa3a4587f5a3622e7b48d75493c8d82f1d163 100644 (file)
@@ -199,7 +199,7 @@ fd5_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
        struct fd5_pipe_sampler_view *so = CALLOC_STRUCT(fd5_pipe_sampler_view);
        struct fd_resource *rsc = fd_resource(prsc);
        enum pipe_format format = cso->format;
-       unsigned lvl, layers;
+       unsigned lvl, layers = 0;
 
        if (!so)
                return NULL;
index 9c42a6b8151fd17b44b1a2886ba5ab5e94967b70..80eb9906ebea393b8566dab053d0276c23fc6abf 100644 (file)
@@ -220,7 +220,7 @@ fd6_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
        struct fd6_pipe_sampler_view *so = CALLOC_STRUCT(fd6_pipe_sampler_view);
        struct fd_resource *rsc = fd_resource(prsc);
        enum pipe_format format = cso->format;
-       unsigned lvl, layers;
+       unsigned lvl, layers = 0;
 
        if (!so)
                return NULL;