From 150c289f6067cb1ba4572f9124948a94ef94c839 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Fri, 4 Dec 2015 21:26:50 +1100 Subject: gallium/auxiliary: 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/auxiliary/draw/draw_vs_llvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/auxiliary/draw/draw_vs_llvm.c') diff --git a/src/gallium/auxiliary/draw/draw_vs_llvm.c b/src/gallium/auxiliary/draw/draw_vs_llvm.c index ac3999efc68..c92e4317216 100644 --- a/src/gallium/auxiliary/draw/draw_vs_llvm.c +++ b/src/gallium/auxiliary/draw/draw_vs_llvm.c @@ -86,7 +86,7 @@ draw_create_vs_llvm(struct draw_context *draw, { struct llvm_vertex_shader *vs = CALLOC_STRUCT( llvm_vertex_shader ); - if (vs == NULL) + if (!vs) return NULL; /* we make a private copy of the tokens */ -- cgit v1.2.3