Received: by 10.223.185.116 with SMTP id b49csp2018374wrg; Mon, 12 Feb 2018 02:55:16 -0800 (PST) X-Google-Smtp-Source: AH8x225h1SqLD2rooCUnvEIorCZKbyWV2bTDlsxDzwmbJbmnzYs2M6JJSlDRBLP+FITSDiVGFDAs X-Received: by 10.98.87.195 with SMTP id i64mr11390760pfj.34.1518432916575; Mon, 12 Feb 2018 02:55:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518432916; cv=none; d=google.com; s=arc-20160816; b=vMYRMJNVX7tcyU24TKHdSLD5A2Q8Igf+NZNQntQ6s1RkhMdF/RjKx1N57DsmOEIRlR Oi602CSDq90KPt3Ll0F0zoDrHHe3Qy3j0eEcybYwAc+8f0LF6qT380uUHUNJKVuixNZL le+c1lCmh/C+V8CtaqIXY50LHCoflzi3JSkj4U9K05kzY9VVMHNPePzv4I2ajf4kzlP5 Yd9wPO9tPoKsQpp6epevdf7L6BF+S8ErsG+cD2+LUVtFc3B8T14VjgEMz17ARFXeU/76 AWNN3ApH3nQ8bjJ8NHjKi24L63kEPeCsFKEAmf6Dcom7bOVrMhwbImLMxUweJTK9Mqa6 CL8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=n4eNX6adkqtFwDQu1SKEjJHn/e0DUd9jdcHSMWC8GXE=; b=OExbP0wELTscEd9+cwuPHDKO2PwfYvybGiUUH3CtXDpIvBY75lppKsVKrwfm8EKisU euEhn3twY2jrm/No4dUL+fbELKaVfsX/VhUH6+84CXwS9JaxnAdA4kjSCBBwqCjq79in RWNTL8JHafZCvxJsssi0rJJMHKGnkm130eEfE+/8DN8aYeBtvH6EPl9/9eRJQWYJX4rl gkZNE0LITM9yRwswLyQ0uTelyE1ImNfNt8NVv8ftKc4e2OmGXw9e9QNnG+WGPCHeulX0 wN6YEJv03MTFejHo4vpNBg85lOGqmzJ1gF6M82ZnSyfjg34cr+lffa7VyqmCHVmuQMJN jF7g== 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 i5-v6si5724258plr.335.2018.02.12.02.55.02; Mon, 12 Feb 2018 02:55:16 -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 S933900AbeBLKxc (ORCPT + 99 others); Mon, 12 Feb 2018 05:53:32 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:5202 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754009AbeBLKwh (ORCPT ); Mon, 12 Feb 2018 05:52:37 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 62D233521502F; Mon, 12 Feb 2018 18:52:24 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.361.1; Mon, 12 Feb 2018 18:52:17 +0800 From: Yisheng Xie To: , , CC: , , Yisheng Xie Subject: [PATCH v2 8/9] staging: android: ion: Cleanup ion_page_pool_alloc_pages Date: Mon, 12 Feb 2018 18:43:13 +0800 Message-ID: <1518432194-41536-9-git-send-email-xieyisheng1@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1518432194-41536-1-git-send-email-xieyisheng1@huawei.com> References: <1518432194-41536-1-git-send-email-xieyisheng1@huawei.com> 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. Acked-by: Sumit Semwal 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