From: Rob Clark Date: Thu, 2 Jun 2016 15:47:11 +0000 (-0400) Subject: freedreno/a4xx: silence coverity warning X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=80c288603300a06ac1585769cc491711c3d1b4f0;p=mesa.git freedreno/a4xx: silence coverity warning CID 1362451 Signed-off-by: Rob Clark --- diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_program.c b/src/gallium/drivers/freedreno/a4xx/fd4_program.c index 9dc4ebbf086..4590c0e7df9 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_program.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_program.c @@ -121,6 +121,12 @@ emit_shader(struct fd_ringbuffer *ring, const struct ir3_shader_variant *so) OUT_RELOC(ring, so->bo, 0, CP_LOAD_STATE_1_STATE_TYPE(ST_SHADER), 0); } + + /* for how clever coverity is, it is sometimes rather dull, and + * doesn't realize that the only case where bin==NULL, sz==0: + */ + assume(bin || (sz == 0)); + for (i = 0; i < sz; i++) { OUT_RING(ring, bin[i]); }