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/nouveau/nouveau_compiler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/drivers/nouveau/nouveau_compiler.c') diff --git a/src/gallium/drivers/nouveau/nouveau_compiler.c b/src/gallium/drivers/nouveau/nouveau_compiler.c index 495450b317a..670b0c8b135 100644 --- a/src/gallium/drivers/nouveau/nouveau_compiler.c +++ b/src/gallium/drivers/nouveau/nouveau_compiler.c @@ -168,7 +168,7 @@ main(int argc, char *argv[]) else f = fopen(filename, "r"); - if (f == NULL) { + if (!f) { _debug_printf("Error opening file '%s': %s\n", filename, strerror(errno)); return 1; } -- cgit v1.2.3