summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
diff options
context:
space:
mode:
authorEdward O'Callaghan <[email protected]>2015-12-04 22:08:22 +1100
committerMarek Olšák <[email protected]>2015-12-06 17:10:23 +0100
commit13eb5f596bc8ece3d1805b388aa53917e6158d7b (patch)
treeda4ab5c8fd897b317d7f66004fdd22cd02ebe84c /src/gallium/drivers/softpipe
parent150c289f6067cb1ba4572f9124948a94ef94c839 (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/softpipe')
-rw-r--r--src/gallium/drivers/softpipe/sp_state_shader.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_shader.c b/src/gallium/drivers/softpipe/sp_state_shader.c
index 8ab2903dced..dce0404de5b 100644
--- a/src/gallium/drivers/softpipe/sp_state_shader.c
+++ b/src/gallium/drivers/softpipe/sp_state_shader.c
@@ -207,7 +207,7 @@ softpipe_create_vs_state(struct pipe_context *pipe,
struct sp_vertex_shader *state;
state = CALLOC_STRUCT(sp_vertex_shader);
- if (state == NULL )
+ if (!state)
goto fail;
/* copy shader tokens, the ones passed in will go away.
@@ -269,7 +269,7 @@ softpipe_create_gs_state(struct pipe_context *pipe,
struct sp_geometry_shader *state;
state = CALLOC_STRUCT(sp_geometry_shader);
- if (state == NULL )
+ if (!state)
goto fail;
state->shader = *templ;
diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c
index 3347f5f1883..52df89504b8 100644
--- a/src/gallium/drivers/softpipe/sp_texture.c
+++ b/src/gallium/drivers/softpipe/sp_texture.c
@@ -435,7 +435,7 @@ softpipe_transfer_map(struct pipe_context *pipe,
map = spr->data;
}
- if (map == NULL) {
+ if (!map) {
pipe_resource_reference(&pt->resource, NULL);
FREE(spt);
return NULL;