Received: by 10.223.176.5 with SMTP id f5csp49513wra; Tue, 6 Feb 2018 16:58:30 -0800 (PST) X-Google-Smtp-Source: AH8x225UD8qfiV+9QHOvL8De4DI1ggwm5uQsJEZs79iR/yWawOwLpNGHJBtNc26dowDqWvnSLAVK X-Received: by 2002:a17:902:c81:: with SMTP id 1-v6mr4146152plt.281.1517965110366; Tue, 06 Feb 2018 16:58:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517965110; cv=none; d=google.com; s=arc-20160816; b=OuFiV5Z2WJetiELzcgC9hoUNaxjUMg0KeRse8Ppilkf2jTznbbNRspIlq+UOiPg1IV /R/KKCr1A0mWSlytEwTIgQbAZdO0c6sLidhJYX4iabZ5Fsc/qISQLtB4l21wIhXH7vuD twNsdsXCgksuffSLcK0+gyBdb9YfbWm4sRuLlOoDpIy4S/VFfyNIAyt7TxoHpaMxP1B9 nKKmIs45wd4lQgGjyG2pwvfM2fvZNmomMznEfyjzps6Adni+hR1cjwHF8CBmhByIIJSA adoH9YWOn+fbuZaZc2idQBYuagERdJABG6SnNCRijVRu44TNyI+vQGk+x4guudME+HNi mGEA== 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=10U4wkRigmL6uJKldXXBRL5pP3RMPPKjHMDSR4524VA=; b=gvhLIUZH2WKaxhBF8cWT/cQlJITjEu2LEFitOoYIZzCbIAtk+5eB7ppUplRmq83gbR OMPoiIzFRYVqv9dGyp2P1IHcFL1fPZVUEJi1VTzPPZUe3UIXxFbemgM3TprgDNh919Gg 7jzKGWQJpGIS0TbcIy9lEP9PkZArrsv+SdyrowJhFNuv1KwsxBExS25CvY51I13AypYM k/XdnXe7hDb1AzoetFC0GYb56ra+JBOsbHVz1WtchwFr8QgdOi+HA0NOwScCL3EKWp4k 4LmpaGfFuPtGt7b0d6vK255Yj1o32tyFPUgiO/cE5EBTppHeC2MrEWy3i9poPUTGrwTr U9Iw== 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 n15si197357pgc.49.2018.02.06.16.58.15; Tue, 06 Feb 2018 16:58:30 -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 S932199AbeBGA5U (ORCPT + 99 others); Tue, 6 Feb 2018 19:57:20 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:51683 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932142AbeBGA5T (ORCPT ); Tue, 6 Feb 2018 19:57:19 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D6E1675D17F6F; Wed, 7 Feb 2018 08:57:06 +0800 (CST) Received: from [127.0.0.1] (10.177.29.40) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.361.1; Wed, 7 Feb 2018 08:57:04 +0800 Subject: Re: [PATCH 1/2] staging: android: ion: Remove dead code in ion_page_pool_free To: Laura Abbott , References: <1517801177-37021-1-git-send-email-xieyisheng1@huawei.com> <6286ae0a-f439-3477-91bb-8df0e454b98e@redhat.com> CC: , From: Yisheng Xie Message-ID: <3e68a118-0d6f-2a42-0df1-3b0021ce5ca7@huawei.com> Date: Wed, 7 Feb 2018 08:57:02 +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: Content-Type: text/plain; charset="utf-8" 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 Laura, On 2018/2/7 7:11, Laura Abbott wrote: > On 02/06/2018 03:10 PM, Laura Abbott wrote: >> On 02/04/2018 07:26 PM, 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. >>> >> >> Can you clean up ion_page_pool_add to be a void return as well? >> No sense in having it just always return 0. >> > > Nevermind, just saw the follow up patch. Both of them: > > Acked-by: Laura Abbott Thanks. If you do not mind, I will send out another two cleanup patchs: cleanup ion_page_pool_alloc_pages() and combine cache/uncache pools into one pools. Thanks > >>> Signed-off-by: Yisheng Xie >>> --- >>> 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) >>> >> > > >