Received: by 10.223.185.116 with SMTP id b49csp2153985wrg; Mon, 12 Feb 2018 05:20:35 -0800 (PST) X-Google-Smtp-Source: AH8x225LTnRkxxXCMr8Vra2gbYWfVLqXlx7f+1isTA0IGP0HHUqe8hnkwGrpHzktbnUwFMJ1FoWZ X-Received: by 2002:a17:902:a711:: with SMTP id w17-v6mr10382020plq.299.1518441634993; Mon, 12 Feb 2018 05:20:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518441634; cv=none; d=google.com; s=arc-20160816; b=FXf0T8+hK+7KTulOVih3TKZQ4KiveuUSggdMJ0fUSeAIqVcnpUvCBCapnoElQsJh3u I5tFIhMADf2jv/25+PW1KDAtdvCQRYjugBGipbqTmrs0lir2hF7LtDJi/+RT/PchvuFh ITUoVgXlHeDASwFMouvwvvT0aIvWWwINJRM7qITeZC3tTz9EC6FIsJ0l+rp8oJeduxLX xQ3JoJNWkTFeAEnZ2JSXsEdwy2Ro2Og04f8yEmAksjI8qFJjyVsqBIDx2N2gDRx1p8uE zOBQFgQGfhMc0nilJxorSQNnHbUUpF5kAhzbsyx/P18wA/loLT62y9+jogtS1QxS0QJ9 vnpg== 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=yAvSqseAf+0XqCU9fyJ0p4KVn+2aJgISATUOM6eoJDI=; b=BUf0EPzQgxJvzQDt7VnQSHT3j+xrL08yTwyZJZbHmre1yYlm5H83JK2LjT1pXLl2Mw aXzqvklVlB7rai8dK6lF7n4d7OAAt+BVnTNs3uGOw4SZfihIpAOrRLxz8vGw120tA4EF JabxQLoKA/gPsY1OZGadE5drlCqbCJRE+fvXJztzqpT4rjx+6A6YzK6Pd2uu7cDbaOeS 1jFqjysBWSSkbY2DT9vd0KOjmhEFsik49IwlYV4f6GuuEEYRdnFQtbyai2cBxbCpttf2 mQiYWYuS+TdiaS3UOZ+QE/fdqCH6v8sW//bn23RPnUk6K//UQd+c+VTgSotV8KB3NaB2 bTLg== 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 t6-v6si3983977plr.777.2018.02.12.05.20.20; Mon, 12 Feb 2018 05:20:34 -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 S933829AbeBLKwo (ORCPT + 99 others); Mon, 12 Feb 2018 05:52:44 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:5204 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933798AbeBLKwi (ORCPT ); Mon, 12 Feb 2018 05:52:38 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 9EC3167ACBED3; 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:16 +0800 From: Yisheng Xie To: , , CC: , , Yisheng Xie Subject: [PATCH v2 6/9] staging: android: ion: Remove dead code in ion_page_pool_free Date: Mon, 12 Feb 2018 18:43:11 +0800 Message-ID: <1518432194-41536-7-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_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. Acked-by: Laura Abbott 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