util: remove unused variable
authorTimothy Arceri <timothy.arceri@collabora.com>
Fri, 7 Oct 2016 10:10:37 +0000 (21:10 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Fri, 7 Oct 2016 10:24:50 +0000 (21:24 +1100)
Also initialise page at declaration.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/util/slab.c

index cbe4c88..4264814 100644 (file)
@@ -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;