summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_state.c
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/r600/r600_state.c
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/r600/r600_state.c')
-rw-r--r--src/gallium/drivers/r600/r600_state.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index 1f9ae912d4f..b11cfeab17e 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -390,7 +390,7 @@ static void *r600_create_dsa_state(struct pipe_context *ctx,
unsigned db_depth_control, alpha_test_control, alpha_ref;
struct r600_dsa_state *dsa = CALLOC_STRUCT(r600_dsa_state);
- if (dsa == NULL) {
+ if (!dsa) {
return NULL;
}
@@ -446,7 +446,7 @@ static void *r600_create_rs_state(struct pipe_context *ctx,
float psize_min, psize_max;
struct r600_rasterizer_state *rs = CALLOC_STRUCT(r600_rasterizer_state);
- if (rs == NULL) {
+ if (!rs) {
return NULL;
}
@@ -559,7 +559,7 @@ static void *r600_create_sampler_state(struct pipe_context *ctx,
struct r600_pipe_sampler_state *ss = CALLOC_STRUCT(r600_pipe_sampler_state);
unsigned aniso_flag_offset = state->max_anisotropy > 1 ? 4 : 0;
- if (ss == NULL) {
+ if (!ss) {
return NULL;
}
@@ -642,7 +642,7 @@ r600_create_sampler_view_custom(struct pipe_context *ctx,
unsigned char swizzle[4], array_mode = 0;
unsigned width, height, depth, offset_level, last_level;
- if (view == NULL)
+ if (!view)
return NULL;
/* initialize base object */