Received: by 10.223.185.116 with SMTP id b49csp2388695wrg; Mon, 12 Feb 2018 08:47:53 -0800 (PST) X-Google-Smtp-Source: AH8x225lfzjdOXo2j6MaomZ9zpsIx3FMlEIAd039AFRuOHK69cQuxM+/gZWXaSjQtlpHLn2WbJon X-Received: by 10.98.237.21 with SMTP id u21mr7230621pfh.190.1518454073073; Mon, 12 Feb 2018 08:47:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518454073; cv=none; d=google.com; s=arc-20160816; b=qGbfuZ0ij4V0Y9FOY8fqmhmtr/JYqgekuhr/Wf5ZqYkY33Y6nx1JAWXKFOivcz3r4M 9Qtsn/n/BD8oNqUF7An3hZSGVYV9OEOdyQ9nnXT8PqbdwWfC2aZNntUIY26F3Y960BGv OgGOBzNbOeWw/hr/bXI6a/D3DeNtJHM24B1GqiiotuyGTQsvtU0/LW0h6f9bVuwO+lFb eKGjKjR5rzIasUKgcm5gg+YQZywbAEK8ys3YYkr6EYFcVXLNqZIt9dxquDWLS7YZsmwk 59Cq+l6OvTFQeyOMF6WwFOUQNjaKbaGc3XBGfsWDYtiHrzla8zjrltBQujfwLYSlz8Z7 jv0Q== 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=ENQniBzWuoqFmfB1GKUelElCf93glh9NTqXhnh8qpbc=; b=GDI6ieGe1VWCdpcFoocmvqwFQAUhARQJTI745bBmdvi9nRwEm9KUTx24Y2yotCz1ZC Dk7hmnLBgp+kSWSKHo8iVQOeqSHzspK6kwuKO2kkGUdqAJKwaBIn1pElxFuFA8zmOHos pqFEIdwesaJ/GfgsAXL/ZV+XWRmDIsq1jeB2NtMT6LpGpj5Od0lzP/DReNpjipRcTn07 Jbt2xV0lDDX0JWEmCUQsbGoyaXlYUT8nkzSiOV6b+18z/gtqnm8M7qTRGtQcWP6TiuJ7 O5sW84rHWHqRWJJ2dkcDcXXGkC0F4THW+bOi03ittnFjhR3CSYSh2b+9ntanUJP0i4jQ 8hpw== 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 p61-v6si3676576plb.208.2018.02.12.08.47.38; Mon, 12 Feb 2018 08:47:53 -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 S934127AbeBLLlZ (ORCPT + 99 others); Mon, 12 Feb 2018 06:41:25 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:5225 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754084AbeBLLlY (ORCPT ); Mon, 12 Feb 2018 06:41:24 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 78FB12FC99114; Mon, 12 Feb 2018 19:41:11 +0800 (CST) Received: from [127.0.0.1] (10.177.29.40) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.361.1; Mon, 12 Feb 2018 19:41:11 +0800 Subject: Re: [PATCH 1/2] staging: android: ion: Remove dead code in ion_page_pool_free To: , References: <1517801177-37021-1-git-send-email-xieyisheng1@huawei.com> CC: , From: Yisheng Xie Message-ID: Date: Mon, 12 Feb 2018 19:40:58 +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: <1517801177-37021-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/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 > --- > 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) >