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/nvc0/nvc0_screen.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/nvc0/nvc0_screen.c')
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_screen.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c b/src/gallium/drivers/nvc0/nvc0_screen.c index eb74e955f52..d4487442a55 100644 --- a/src/gallium/drivers/nvc0/nvc0_screen.c +++ b/src/gallium/drivers/nvc0/nvc0_screen.c @@ -256,8 +256,7 @@ nvc0_screen_destroy(struct pipe_screen *pscreen) if (screen->base.pushbuf) screen->base.pushbuf->user_priv = NULL; - if (screen->blitctx) - FREE(screen->blitctx); + FREE(screen->blitctx); nouveau_bo_ref(NULL, &screen->text); nouveau_bo_ref(NULL, &screen->uniform_bo); @@ -269,8 +268,7 @@ nvc0_screen_destroy(struct pipe_screen *pscreen) nouveau_heap_destroy(&screen->lib_code); nouveau_heap_destroy(&screen->text_heap); - if (screen->tic.entries) - FREE(screen->tic.entries); + FREE(screen->tic.entries); nouveau_mm_destroy(screen->mm_VRAM_fe0); |