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/svga/svga_state_constants.c | |
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/svga/svga_state_constants.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_state_constants.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/drivers/svga/svga_state_constants.c b/src/gallium/drivers/svga/svga_state_constants.c index c93d2a5e565..2cf41134bd6 100644 --- a/src/gallium/drivers/svga/svga_state_constants.c +++ b/src/gallium/drivers/svga/svga_state_constants.c @@ -459,7 +459,7 @@ emit_consts_vgpu9(struct svga_context *svga, unsigned shader) data = (const float (*)[4]) pipe_buffer_map(&svga->pipe, svga->curr.constbufs[shader][0].buffer, PIPE_TRANSFER_READ, &transfer); - if (data == NULL) { + if (!data) { return PIPE_ERROR_OUT_OF_MEMORY; } @@ -747,7 +747,7 @@ emit_fs_consts(struct svga_context *svga, unsigned dirty) /* SVGA_NEW_FS_VARIANT */ - if (variant == NULL) + if (!variant) return PIPE_OK; /* SVGA_NEW_FS_CONST_BUFFER @@ -782,7 +782,7 @@ emit_vs_consts(struct svga_context *svga, unsigned dirty) /* SVGA_NEW_VS_VARIANT */ - if (variant == NULL) + if (!variant) return PIPE_OK; /* SVGA_NEW_VS_CONST_BUFFER @@ -816,7 +816,7 @@ emit_gs_consts(struct svga_context *svga, unsigned dirty) /* SVGA_NEW_GS_VARIANT */ - if (variant == NULL) + if (!variant) return PIPE_OK; /* SVGA_NEW_GS_CONST_BUFFER |