Received: by 10.223.176.5 with SMTP id f5csp1224664wra; Tue, 6 Feb 2018 15:11:29 -0800 (PST) X-Google-Smtp-Source: AH8x2276Bk6VuPPQf3vl79v+Oih24ctA/Ky8FA1CSnKwCpxUK0FEwRsNV1EHvbA6sgNnm8+VJz6M X-Received: by 10.99.179.77 with SMTP id x13mr3191020pgt.135.1517958689754; Tue, 06 Feb 2018 15:11:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517958689; cv=none; d=google.com; s=arc-20160816; b=0IsN9e5L6wWQDQdqu2bQC58ROU33ggfRQejXokpKcKr2Sd9w1fULX59P4G62SMYFMa 0FBu+QR6blMfVseHY8nyQ0vWgSbuiS/qPxo+HDiT/1FA1+Kf9551FbRiXf7uQhjDLMYn pR/bJKrOjdFJsI1UCV+3d5jKUCOeqroTkJdw9AgDtuQ/JxszpcNP6FNv0VI6edp6o0TA O9VTXZDwexwtl1ckZ1t/nSCQGxqomlyAIEm9a8h3jttMpCMbkF8QZrZWGg7stBvJHkPQ G/Z37C+r9S9wpagyG0ZvPpn2EJn7XjzFY/3fPioUpXBAXAnMcZb37f8V4qLw2CFiNTvg lvLA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=kQfJqgCiLGACgBYlm99gCSeXtCoYbm/4541LiqTrC0U=; b=diOKxVAyaxSYy1lqR9YM5pYG8rK3d9VaFsvklS9fU3v0LgGlgUQZ+dQT7Y0J16rdJc RFT8r1q0LYUoph00FXsWoAwkw3x5B6QrhIwaknASGb0CwVxdpiwvG9zMAMOXlImh/Bxy B+CFnRqaMmULLi1A7kygSo2eMr13hUIXjnyGPRc31eqERk4N5kO4xGYISrFV8DqbCY7h ZwmiFe+zXZRd7DC53AClKFBXTD2yBno2TlUqlX+n+WPZykub69tfwioXk45mcOtsuDB6 KGXnf7y/8sjKaixj+3ZJ/j/4NtMPbqqDAatS6wp0Zy6kbCk+OrOXjZlBLAEDU4BVn9oS UrBg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a15-v6si58466pll.304.2018.02.06.15.11.14; Tue, 06 Feb 2018 15:11:29 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753647AbeBFXKf (ORCPT + 99 others); Tue, 6 Feb 2018 18:10:35 -0500 Received: from mail-ot0-f193.google.com ([74.125.82.193]:33456 "EHLO mail-ot0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753184AbeBFXKe (ORCPT ); Tue, 6 Feb 2018 18:10:34 -0500 Received: by mail-ot0-f193.google.com with SMTP id q9so3424689oti.0 for ; Tue, 06 Feb 2018 15:10:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kQfJqgCiLGACgBYlm99gCSeXtCoYbm/4541LiqTrC0U=; b=Aubn6yluzfCYOJh1pMFlvwZrw3wWSn/wKaLDwHyztdr0edRBEoI5nsPz0lnZ3regYl mPXA0MTDomgq+yZK4LR9yd7x0H7y//zUOjefRDQyedybPz4GlqA/UxWwwYM0hlmLe0XT wDNLlotB+K159HRRtbBEfJWLd0VYy0IEqbE1nFVIiSJyhD4P34qFUcNPRY6lAt6fxpvr VY0UPcrbw0+D4HwXZ8w0WyOakkz1HCjp2tDIE9xZ4acb/TUlYbwX/Rirbuo+1I7HQjkD G9F5xMFL6Z6SRmMPsAN+IDpjvMINd2wtm/dyISvh+GSpbno9ChHg6Q2SFfPtrmhS5TN1 ckDw== X-Gm-Message-State: APf1xPClIE1GlH6cx3XjI8mxbEp5qFLQf+HNDV6wqWrMMk6Rj/O09LQV gqW7HK9QTK1Y6eklOBMTVQ+5LFaKiis= X-Received: by 10.157.92.193 with SMTP id r1mr3040205oti.221.1517958633182; Tue, 06 Feb 2018 15:10:33 -0800 (PST) Received: from ?IPv6:2601:602:9802:a8dc::f21a? ([2601:602:9802:a8dc::f21a]) by smtp.gmail.com with ESMTPSA id w85sm79828oiw.3.2018.02.06.15.10.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Feb 2018 15:10:31 -0800 (PST) Subject: Re: [PATCH 1/2] staging: android: ion: Remove dead code in ion_page_pool_free To: Yisheng Xie , gregkh@linuxfoundation.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org References: <1517801177-37021-1-git-send-email-xieyisheng1@huawei.com> From: Laura Abbott Message-ID: <6286ae0a-f439-3477-91bb-8df0e454b98e@redhat.com> Date: Tue, 6 Feb 2018 15:10:30 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1517801177-37021-1-git-send-email-xieyisheng1@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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) >