summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2012-09-04 23:33:28 -0700
committerMatt Turner <[email protected]>2012-09-05 22:28:50 -0700
commitb6109de34f04747ed2937a2e63c1f53740202d3e (patch)
tree6578024b65adc9dc2bc3bd4a23cf44f29808b3b2 /src/gallium/drivers/r300
parentda3282b6e2f374b88daf09f7f3ba5b05af45f51a (diff)
Remove useless checks for NULL before freeing
Same as earlier commit, except for "FREE" This patch has been generated by the following Coccinelle semantic patch: // Remove useless checks for NULL before freeing // // free (NULL) is a no-op, so there is no need to avoid it @@ expression E; @@ + FREE (E); + E = NULL; - if (unlikely (E != NULL)) { - FREE(E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; type T; @@ + FREE ((T) E); + E = NULL; - if (unlikely (E != NULL)) { - FREE((T) E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; @@ + FREE (E); - if (unlikely (E != NULL)) { - FREE (E); - } @@ expression E; type T; @@ + FREE ((T) E); - if (unlikely (E != NULL)) { - FREE ((T) E); - } Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_screen_buffer.c3
-rw-r--r--src/gallium/drivers/r300/r300_state.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c
index 7cb8cd60d3e..f652bf72b0c 100644
--- a/src/gallium/drivers/r300/r300_screen_buffer.c
+++ b/src/gallium/drivers/r300/r300_screen_buffer.c
@@ -55,8 +55,7 @@ static void r300_buffer_destroy(struct pipe_screen *screen,
{
struct r300_resource *rbuf = r300_resource(buf);
- if (rbuf->malloced_buffer)
- FREE(rbuf->malloced_buffer);
+ FREE(rbuf->malloced_buffer);
if (rbuf->buf)
pb_reference(&rbuf->buf, NULL);
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 6f9feb10564..46a6bf669b7 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -1840,8 +1840,7 @@ static void r300_delete_vs_state(struct pipe_context* pipe, void* shader)
if (r300->screen->caps.has_tcl) {
rc_constants_destroy(&vs->code.constants);
- if (vs->code.constants_remap_table)
- FREE(vs->code.constants_remap_table);
+ FREE(vs->code.constants_remap_table);
} else {
draw_delete_vertex_shader(r300->draw,
(struct draw_vertex_shader*)vs->draw_vs);