Received: by 10.223.185.116 with SMTP id b49csp2061453wrg; Mon, 12 Feb 2018 03:43:47 -0800 (PST) X-Google-Smtp-Source: AH8x227h3zSrcGo461FAG0MdcM3RUNiihLzS9jZ3ynH65WT61jH5PaX37nWcFqCLvqllq7lMaZQS X-Received: by 2002:a17:902:b7ca:: with SMTP id v10-v6mr8989410plz.437.1518435827487; Mon, 12 Feb 2018 03:43:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518435827; cv=none; d=google.com; s=arc-20160816; b=Yrt1c9xpqj/l+8P6OqyZMUnohMqLgFhEVIVF3NzJND+Ld0p06RGIoMv661aCOg4RJ/ EJeD0vLA3PQnImSV9jNv/wAyJcP8wMKgkN6IQDAtna1aiKz8afO2AGSjY3Afgie0z5qD zRqiCav53k8aU227NpP7YTYLXmVve69PYukV8Xt/oyXOpMwk/WnSZD3szfd5FFpm4gYK cXEVEfnMDkcWiJGsvObrLi9N9/kENhymsGy4vaD5LwJd12DwJVf+3Al8IOH0Xatuovqg A5dXYGEEO9Wl91F8TyVsx7ywM3V2u7uLCUaB4zmdvkwTLhlfXH8SN2DRKw4bmF066Glj Mgdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=3v/op0TG+/sUKkkl1/CcA6soic3pUn71yQ07wbLwxrw=; b=Wo0jG8xASVtcvi1eVAWBAEEpjtYYBlO5PArnPXPArNfiXqL2PHTgq5MW+7PShjFjb+ WRt+Qr3nl60ho3ILRDsVajxHgvPkdG3hBvoNGabz77vcoVb5OI7DZ1GdwV+uAaM+kzru xzwDe0JDz+yMkLtHkQA2mPVJMpHF2TkD2/u4g2wKgL4eoRlC0OMphc4wvlJvJ3ktDVmI WjxVridH7K6Ndp8TW6DHp567elQp2KhEaUC7hx3Xp4T8D3LSsOS5taxKRfjkX1YwJ/qa 17PZZ9Tak65Dq1iVJei6hwC5lYITVkPJTKoHj+jqeSN8QNLWeDiACo7L440m8tS9ZjKy kOGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o18si6186526pfa.407.2018.02.12.03.43.33; Mon, 12 Feb 2018 03:43:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934158AbeBLLlo (ORCPT + 99 others); Mon, 12 Feb 2018 06:41:44 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:5207 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934139AbeBLLln (ORCPT ); Mon, 12 Feb 2018 06:41:43 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 0046151864FBF; Mon, 12 Feb 2018 19:41:29 +0800 (CST) Received: from [127.0.0.1] (10.177.29.40) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.361.1; Mon, 12 Feb 2018 19:41:29 +0800 Subject: Re: [PATCH 1/2] staging: android: ion: Cleanup ion_page_pool_alloc_pages To: , References: <1517975986-46917-1-git-send-email-xieyisheng1@huawei.com> CC: , From: Yisheng Xie Message-ID: <11ed8ba5-e6d2-1d36-cf8b-0eb19c6bcdb0@huawei.com> Date: Mon, 12 Feb 2018 19:41:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <1517975986-46917-1-git-send-email-xieyisheng1@huawei.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.40] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/7 11:59, Yisheng Xie wrote: > 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. > > Signed-off-by: Yisheng Xie > --- > drivers/staging/android/ion/ion_page_pool.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/android/ion/ion_page_pool.c b/drivers/staging/android/ion/ion_page_pool.c > index e3a6e32..6d2caf0 100644 > --- a/drivers/staging/android/ion/ion_page_pool.c > +++ b/drivers/staging/android/ion/ion_page_pool.c > @@ -11,13 +11,9 @@ > > #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, >