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/nv50/nv50_program.c | |
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/nv50/nv50_program.c')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_program.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index 72d14a6e3a0..0d292f7ab89 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -343,8 +343,7 @@ nv50_program_translate(struct nv50_program *prog, uint16_t chipset) NOUVEAU_ERR("shader translation failed: %i\n", ret); goto out; } - if (info->bin.syms) /* we don't need them yet */ - FREE(info->bin.syms); + FREE(info->bin.syms); prog->code = info->bin.code; prog->code_size = info->bin.codeSize; @@ -428,14 +427,11 @@ nv50_program_destroy(struct nv50_context *nv50, struct nv50_program *p) if (p->mem) nouveau_heap_free(&p->mem); - if (p->code) - FREE(p->code); + FREE(p->code); - if (p->fixups) - FREE(p->fixups); + FREE(p->fixups); - if (p->so) - FREE(p->so); + FREE(p->so); memset(p, 0, sizeof(*p)); |