OSDN Git Service

staging: android: ion: Cleanup ion_page_pool_alloc_pages
authorYisheng Xie <xieyisheng1@huawei.com>
Mon, 12 Feb 2018 10:43:13 +0000 (18:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 16:29:07 +0000 (17:29 +0100)
ion_page_pool_alloc_pages calls alloc_pages to allocate pages for page
pools. If alloc_pages return NULL, it will return NULL, or it will
return the pages allocate from alloc_pages. So we can just return
alloc_pages without any judgement.

Acked-by: Sumit Semwal <sumit.semwal@linaro.org>
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 e3a6e32..6d2caf0 100644 (file)
 
 #include "ion.h"
 
-static void *ion_page_pool_alloc_pages(struct ion_page_pool *pool)
+static inline struct page *ion_page_pool_alloc_pages(struct ion_page_pool *pool)
 {
-       struct page *page = alloc_pages(pool->gfp_mask, pool->order);
-
-       if (!page)
-               return NULL;
-       return page;
+       return alloc_pages(pool->gfp_mask, pool->order);
 }
 
 static void ion_page_pool_free_pages(struct ion_page_pool *pool,