Mesa (master): util: remove unused variable

Timothy Arceri tarceri at kemper.freedesktop.org
Fri Oct 7 10:24:59 UTC 2016


Module: Mesa
Branch: master
Commit: 965ebc8b286afee827b820479cc1714a2aeb46cc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=965ebc8b286afee827b820479cc1714a2aeb46cc

Author: Timothy Arceri <timothy.arceri at collabora.com>
Date:   Fri Oct  7 21:10:37 2016 +1100

util: remove unused variable

Also initialise page at declaration.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

---

 src/util/slab.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/util/slab.c b/src/util/slab.c
index cbe4c88..4264814 100644
--- a/src/util/slab.c
+++ b/src/util/slab.c
@@ -174,11 +174,9 @@ void slab_destroy_child(struct slab_child_pool *pool)
 static bool
 slab_add_new_page(struct slab_child_pool *pool)
 {
-   struct slab_page_header *page;
-   unsigned i;
+   struct slab_page_header *page = malloc(sizeof(struct slab_page_header) +
+      pool->parent->num_elements * pool->parent->element_size);
 
-   page = malloc(sizeof(struct slab_page_header) +
-                 pool->parent->num_elements * pool->parent->element_size);
    if (!page)
       return false;
 




More information about the mesa-commit mailing list