Received: by 10.223.176.5 with SMTP id f5csp2061416wra; Sun, 4 Feb 2018 19:37:18 -0800 (PST) X-Google-Smtp-Source: AH8x224EeHU6EbcTl87RKWELnXo4MIYmE5jKA/LTwbly0W/+sALCbZtkr93d/eOnpRS+X6EKTBNk X-Received: by 10.99.36.65 with SMTP id k62mr6189097pgk.345.1517801838060; Sun, 04 Feb 2018 19:37:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517801838; cv=none; d=google.com; s=arc-20160816; b=IgtHP93fBJQQ9VJRSMOGMkPSMiFlBHTHr9JTMk8MYmXfd22uZiEJPyKD1tg0NV5uXZ kQ52WvKC1YRuKKY8pmcQXQtrTVFlXptgY8zYRpzPIiki5dIXLkKh3bPHQr0/qKQIBExv zy9Kq83yxqi4n8qAg8Js7pLrt8B70SPR2CaBf47eVWIqle5kebzi8xAOOV3SN9yG/UAx 5x1bCi3tdR3Gp1pIrMzGge20vGTzfVZK8PWSuK2Sjv5Q9DLGMb3ipHzsxUMG8DPwLw5o gbZcxgPWyOipL4GaTiqEHL7ievtG8hLqPUchuKI32H+ZTQmd7LkrpAmHgChPM7PlNYbX t/ZA== 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=s7R0t47vRu09PUTfy3Z13vkbGqS+eb7fLnN+2KFvWpI=; b=RwXubvThZLqmfSfcLfrTk45QDMTTbCEmPHDyDqtjy3ByNcYjvG3srK4Tj3PifUBIAp 9vQ3vT2OWmS3r3+UijQrKLAFv0T7yQsbyuftacuXZVihXLt3nDiY5wjybFNrz7/cHLxF d3yIydfLka4kSPWFnYfYSFGErE6vPjXpUKJWdb72zUskv2M8vdH78jDcNyi8UdynMX2b QlLr4MgpWrgtIsd4Y6Ts+ez7iD6RJNzOubf+Oja5sQBmTTC0b+5gLSyUmWW5019KGNId 2ZBTaQp//HyGlrLfG20GkaQPhDRI8XAk8M2o38oP0cCxGTD1z7lyiYoeoyqMMsBlUwx7 n2eg== 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 k91-v6si6253156pld.129.2018.02.04.19.37.02; Sun, 04 Feb 2018 19:37:18 -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 S1752358AbeBEDfy (ORCPT + 99 others); Sun, 4 Feb 2018 22:35:54 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:39817 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751963AbeBEDfq (ORCPT ); Sun, 4 Feb 2018 22:35:46 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 975C934A50CBA; Mon, 5 Feb 2018 11:35:42 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.361.1; Mon, 5 Feb 2018 11:35:37 +0800 From: Yisheng Xie To: , CC: , , Yisheng Xie Subject: [PATCH 1/2] staging: android: ion: Remove dead code in ion_page_pool_free Date: Mon, 5 Feb 2018 11:26:16 +0800 Message-ID: <1517801177-37021-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_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) -- 1.7.12.4