summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_pipe_clear.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <eocallaghan@alterapraxis.com>2015-12-04 22:08:22 +1100
committerMarek Olšák <marek.olsak@amd.com>2015-12-06 17:10:23 +0100
commit13eb5f596bc8ece3d1805b388aa53917e6158d7b (patch)
treeda4ab5c8fd897b317d7f66004fdd22cd02ebe84c /src/gallium/drivers/svga/svga_pipe_clear.c
parent150c289f6067cb1ba4572f9124948a94ef94c839 (diff)
downloadexternal_mesa3d-13eb5f596bc8ece3d1805b388aa53917e6158d7b.zip
external_mesa3d-13eb5f596bc8ece3d1805b388aa53917e6158d7b.tar.gz
external_mesa3d-13eb5f596bc8ece3d1805b388aa53917e6158d7b.tar.bz2
gallium/drivers: Sanitize NULL checks into canonical form
Use NULL tests of the form `if (ptr)' or `if (!ptr)'. They do not depend on the definition of the symbol NULL. Further, they provide the opportunity for the accidental assignment, are clear and succinct. Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/gallium/drivers/svga/svga_pipe_clear.c')
-rw-r--r--src/gallium/drivers/svga/svga_pipe_clear.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c
index bab6178..c874726 100644
--- a/src/gallium/drivers/svga/svga_pipe_clear.c
+++ b/src/gallium/drivers/svga/svga_pipe_clear.c
@@ -178,7 +178,7 @@ try_clear(struct svga_context *svga,
rtv = svga_validate_surface_view(svga,
svga_surface(fb->cbufs[i]));
- if (rtv == NULL)
+ if (!rtv)
return PIPE_ERROR_OUT_OF_MEMORY;
ret = SVGA3D_vgpu10_ClearRenderTargetView(svga->swc,
@@ -191,7 +191,7 @@ try_clear(struct svga_context *svga,
if (flags & (SVGA3D_CLEAR_DEPTH | SVGA3D_CLEAR_STENCIL)) {
struct pipe_surface *dsv =
svga_validate_surface_view(svga, svga_surface(fb->zsbuf));
- if (dsv == NULL)
+ if (!dsv)
return PIPE_ERROR_OUT_OF_MEMORY;
ret = SVGA3D_vgpu10_ClearDepthStencilView(svga->swc, dsv, flags,