From 06168d3f6ab2564664927d823e632939613b27eb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 9 May 2019 17:30:35 -0700 Subject: freedreno: Silence compiler warnings about uninit 'layers' 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 --- src/gallium/drivers/freedreno/a4xx/fd4_texture.c | 2 +- src/gallium/drivers/freedreno/a5xx/fd5_texture.c | 2 +- src/gallium/drivers/freedreno/a6xx/fd6_texture.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_texture.c b/src/gallium/drivers/freedreno/a4xx/fd4_texture.c index 748e08e1f7f..306da8de15b 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_texture.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_texture.c @@ -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) diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_texture.c b/src/gallium/drivers/freedreno/a5xx/fd5_texture.c index e8e29d0367a..1ebaa3a4587 100644 --- a/src/gallium/drivers/freedreno/a5xx/fd5_texture.c +++ b/src/gallium/drivers/freedreno/a5xx/fd5_texture.c @@ -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; diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_texture.c b/src/gallium/drivers/freedreno/a6xx/fd6_texture.c index 9c42a6b8151..80eb9906ebe 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_texture.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_texture.c @@ -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; -- cgit v1.2.3