diff options
author | Matt Turner <[email protected]> | 2012-09-04 23:33:28 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2012-09-05 22:28:50 -0700 |
commit | b6109de34f04747ed2937a2e63c1f53740202d3e (patch) | |
tree | 6578024b65adc9dc2bc3bd4a23cf44f29808b3b2 /src/gallium/drivers/nv30 | |
parent | da3282b6e2f374b88daf09f7f3ba5b05af45f51a (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/nv30')
-rw-r--r-- | src/gallium/drivers/nv30/nvfx_fragprog.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gallium/drivers/nv30/nvfx_fragprog.c b/src/gallium/drivers/nv30/nvfx_fragprog.c index bfec4b3569b..935804e8e14 100644 --- a/src/gallium/drivers/nv30/nvfx_fragprog.c +++ b/src/gallium/drivers/nv30/nvfx_fragprog.c @@ -1101,10 +1101,9 @@ nvfx_fragprog_prepare(struct nv30_context* nvfx, struct nvfx_fpc *fpc) return TRUE; out_err: - if (fpc->r_temp) { - FREE(fpc->r_temp); - fpc->r_temp = NULL; - } + FREE(fpc->r_temp); + fpc->r_temp = NULL; + tgsi_parse_free(&p); return FALSE; } @@ -1218,8 +1217,7 @@ out: tgsi_parse_free(&parse); if(fpc) { - if (fpc->r_temp) - FREE(fpc->r_temp); + FREE(fpc->r_temp); util_dynarray_fini(&fpc->if_stack); util_dynarray_fini(&fpc->label_relocs); util_dynarray_fini(&fpc->imm_data); |