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/radeonsi/si_pipe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gallium/drivers/radeonsi/si_pipe.c') diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 81d809b6b9f..46cb035d74c 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -109,7 +109,7 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, #endif int shader, i; - if (sctx == NULL) + if (!sctx) return NULL; if (sscreen->b.debug_flags & DBG_CHECK_VM) @@ -520,7 +520,7 @@ static void si_destroy_screen(struct pipe_screen* pscreen) { struct si_screen *sscreen = (struct si_screen *)pscreen; - if (sscreen == NULL) + if (!sscreen) return; if (!sscreen->b.ws->unref(sscreen->b.ws)) @@ -611,7 +611,7 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws) { struct si_screen *sscreen = CALLOC_STRUCT(si_screen); - if (sscreen == NULL) { + if (!sscreen) { return NULL; } -- cgit v1.2.3