From: Timothy Arceri Date: Fri, 7 Oct 2016 10:10:37 +0000 (+1100) Subject: util: remove unused variable X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=965ebc8b286afee827b820479cc1714a2aeb46cc;p=mesa.git util: remove unused variable Also initialise page at declaration. Reviewed-by: Nicolai Hähnle --- diff --git a/src/util/slab.c b/src/util/slab.c index cbe4c88d614..4264814cabc 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;