lkml.org 
[lkml]   [2018]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] staging: android: ion: Remove dead code in ion_page_pool_free
From
Date
Hi Greg,

JFYI, I have rebase this patchset to v4.15-rc1.[1]

[1] https://lkml.org/lkml/2018/2/12/204

Thanks
Yisheng

On 2018/2/5 11:26, Yisheng Xie wrote:
> 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.
>
> Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
> ---
> drivers/staging/android/ion/ion_page_pool.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/staging/android/ion/ion_page_pool.c b/drivers/staging/android/ion/ion_page_pool.c
> index 4452e28..150626f 100644
> --- a/drivers/staging/android/ion/ion_page_pool.c
> +++ b/drivers/staging/android/ion/ion_page_pool.c
> @@ -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)
>

\
 
 \ /
  Last update: 2018-02-12 12:42    [W:0.069 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site