diff options
author | Edward O'Callaghan <[email protected]> | 2015-12-04 22:08:22 +1100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-12-06 17:10:23 +0100 |
commit | 13eb5f596bc8ece3d1805b388aa53917e6158d7b (patch) | |
tree | da4ab5c8fd897b317d7f66004fdd22cd02ebe84c /src/gallium/drivers/nouveau | |
parent | 150c289f6067cb1ba4572f9124948a94ef94c839 (diff) |
gallium/drivers: Sanitize NULL checks into canonical form
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 <[email protected]>
Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r-- | src/gallium/drivers/nouveau/nouveau_compiler.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv84_video_vp.c | 4 |
2 files changed, 3 insertions, 3 deletions
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; } diff --git a/src/gallium/drivers/nouveau/nv50/nv84_video_vp.c b/src/gallium/drivers/nouveau/nv50/nv84_video_vp.c index d98992cedd7..811e0c60f83 100644 --- a/src/gallium/drivers/nouveau/nv50/nv84_video_vp.c +++ b/src/gallium/drivers/nouveau/nv50/nv84_video_vp.c @@ -497,9 +497,9 @@ nv84_decoder_vp_mpeg12(struct nv84_decoder *dec, STATIC_ASSERT(sizeof(struct mpeg12_header) == 0x100); - if (ref1 == NULL) + if (!ref1) ref1 = dest; - if (ref2 == NULL) + if (!ref2) ref2 = dest; bo_refs[1].bo = ref1->interlaced; bo_refs[2].bo = ref2->interlaced; |