Received: by 10.223.176.5 with SMTP id f5csp187892wra; Tue, 6 Feb 2018 20:10:27 -0800 (PST) X-Google-Smtp-Source: AH8x225YLHEXtXrp3MAHmm2Z4OnZV+uB/7n8TX7gaRlXfRWMZDZaowwqnOHQG8wLUSaawWIb2JyF X-Received: by 10.99.113.15 with SMTP id m15mr3901445pgc.236.1517976626940; Tue, 06 Feb 2018 20:10:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517976626; cv=none; d=google.com; s=arc-20160816; b=fq6SIlOFHs626tidslRR9TLWpvSAEQSoFkBUDJ8Jh/xXeCUL9pOftFm3DwwPX4ZA5q PnRlX001kHMmfIiUMuH5bft+7qMSMJUvmXZoOW+/V2IPpjl/3IHB+LM/0Boi5eOcLvBg ZwurZ8uK9X7M+hMRahw+d9ZCXOBQXf6m6F2lOZZRYFWs7hF9EUL9m/06r+0Socla7MHX fqyKW/FpeYi/7JDgKhrdcO5fVqZ7llFGWDFHf5U/JPaGH1bpv6640EZon4Pqofo2x2xl oiAVwJausecUSCpFcqLlEi2Ib12++QVdgUO7zsHrhcOvN6gWCzk5uIlM4EAxDi3M0/PO J44g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=8shKL6w8svsJorDSXYtq/9l9vPn6ee+Fb+oazjuuAIc=; b=vQIBR/Otc7RmEfqPJhIkpUWPtq4ksK5htkP29tMz7YMxo5mfZfL9AGNjoaAmTm41Ck X/szxd+XAHKu13XaOIhkyfTGlrSTrmKIFknMR0obgjIAr8nND9YkQxltRQrdeIKJBX90 UUDWCa8tn6cP+O98yGgVtU1/r1FHhC8qcWCe+NO+KUkskCbszQdC43CdhJ/03KKioY1V y/lZXtzy2yJPQ7k0cg7I9gz8MKmtdimBHu7mXfb+R8uiUvpIK8cItySggUhw7k2Vy86U x2o+RMeT5oytB6GChZxOiU6r/jShF70VGjCJvcSoJTab51tqs4tI7zqYxzX1ieXyHPaX frWA== 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 p77si479545pfa.247.2018.02.06.20.10.13; Tue, 06 Feb 2018 20:10:26 -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 S1753198AbeBGEJK (ORCPT + 99 others); Tue, 6 Feb 2018 23:09:10 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:54491 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752848AbeBGEJJ (ORCPT ); Tue, 6 Feb 2018 23:09:09 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 4CF629652210; Wed, 7 Feb 2018 12:08:56 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.361.1; Wed, 7 Feb 2018 12:08:47 +0800 From: Yisheng Xie To: , CC: , , Yisheng Xie Subject: [PATCH 1/2] staging: android: ion: Cleanup ion_page_pool_alloc_pages Date: Wed, 7 Feb 2018 11:59:45 +0800 Message-ID: <1517975986-46917-1-git-send-email-xieyisheng1@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, -- 1.7.12.4