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/postprocess/pp_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/auxiliary/postprocess/pp_init.c') diff --git a/src/gallium/auxiliary/postprocess/pp_init.c b/src/gallium/auxiliary/postprocess/pp_init.c index bdf66e6d63a..b9eff78bf4f 100644 --- a/src/gallium/auxiliary/postprocess/pp_init.c +++ b/src/gallium/auxiliary/postprocess/pp_init.c @@ -58,7 +58,7 @@ pp_init(struct pipe_context *pipe, const unsigned int *enabled, ppq = CALLOC(1, sizeof(struct pp_queue_t)); - if (ppq == NULL) { + if (!ppq) { pp_debug("Unable to allocate memory for ppq.\n"); goto error; } -- cgit v1.2.3