]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: android: ion: Remove dead code in ion_page_pool_free
authorYisheng Xie <xieyisheng1@huawei.com>
Mon, 12 Feb 2018 10:43:11 +0000 (18:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 16:29:07 +0000 (17:29 +0100)
ion_page_pool_add will always return 0, however ion_page_pool_free will
call ion_page_pool_free_pages when ion_page_pool_add's return value is
not 0, so it is a dead code which can be removed.

Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/ion/ion_page_pool.c

index 4452e288c8939bcca67d057991c4e1292c62ba5b..150626ffc24aa8de1977182ac8fd9a6f3824b299 100644 (file)
@@ -79,13 +79,9 @@ struct page *ion_page_pool_alloc(struct ion_page_pool *pool)
 
 void ion_page_pool_free(struct ion_page_pool *pool, struct page *page)
 {
-       int ret;
-
        BUG_ON(pool->order != compound_order(page));
 
-       ret = ion_page_pool_add(pool, page);
-       if (ret)
-               ion_page_pool_free_pages(pool, page);
+       ion_page_pool_add(pool, page);
 }
 
 static int ion_page_pool_total(struct ion_page_pool *pool, bool high)