From 13eb5f596bc8ece3d1805b388aa53917e6158d7b Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Fri, 4 Dec 2015 22:08:22 +1100 Subject: gallium/drivers: Sanitize NULL checks into canonical form MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Marek Olšák --- src/gallium/drivers/svga/svga_tgsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/svga/svga_tgsi.c') diff --git a/src/gallium/drivers/svga/svga_tgsi.c b/src/gallium/drivers/svga/svga_tgsi.c index 4c16f4313a0..c62d4d671ef 100644 --- a/src/gallium/drivers/svga/svga_tgsi.c +++ b/src/gallium/drivers/svga/svga_tgsi.c @@ -71,7 +71,7 @@ svga_shader_expand(struct svga_shader_emitter *emit) else new_buf = NULL; - if (new_buf == NULL) { + if (!new_buf) { emit->ptr = err_buf; emit->buf = err_buf; emit->size = sizeof(err_buf); @@ -229,7 +229,7 @@ svga_tgsi_vgpu9_translate(struct svga_context *svga, } variant = svga_new_shader_variant(svga); - if (variant == NULL) + if (!variant) goto fail; variant->shader = shader; -- cgit v1.2.3