Received: by 10.223.176.5 with SMTP id f5csp1225337wra; Tue, 6 Feb 2018 15:12:17 -0800 (PST) X-Google-Smtp-Source: AH8x227VATDQDlk5gBEfRjCCnTm/MSkPEu/E0pJqKjHbHQlgVemOJFoJ2Y03qFu69XnW4Wa1a0nD X-Received: by 2002:a17:902:44c:: with SMTP id 70-v6mr3829940ple.221.1517958737511; Tue, 06 Feb 2018 15:12:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517958737; cv=none; d=google.com; s=arc-20160816; b=geMi5L12p0RYGtHc93fJ+dOjm5R2thNxP8kXjz9t3cXM6PNn1GmMUiQtenC+iDeY4u 5IJ7OTQow+GB4odU08Xky1ThWcyTcaiW28WoACJKlUzOITZ+jxR143OajD9pMax50Ca/ x7SvruS39fF3PBSjhPVx5AxcF9T2k6oEP+9z81LpmSfo2CFQkl8bXN97EJ+WrzrlsxD+ 3/XShzrKtlLDKrZ/pacSWvU0IBkMi4fv80BLnDHEqg8jmIZDKGNbYwNgaA+eNwMZgKii eJ4pZJHKaV5k7qhhMBtP57AvoRg5qiSCACtRxmjP2lu9ihXAsR/EMnLZ6TXTBcXWKoqU 99Xw== 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:references:cc:to:from:subject:arc-authentication-results; bh=FBJ0wxW2rTGZyE3mVXIvjy2S0zYettb1kNRIQ7v6CIs=; b=BhJclkKY9m49wop00buWiCir2sjO2+yNsIPpEY0DXiTZXEcBkAw8LPTYUbKW40w6mU IfNhbEb9aVKQ7ZhayuM4cnCU+IZcm9xlug59nHRzUNxbOnJZ0tehy/QX9yDQHWA+1GFb 5r7LxP4D3uaK99SjXdAPM0gcbestWFaiXF5qRlk7WrQD8ms65ZxPo+5iT/2Dz1YUlsVH xwrBVj86EvgqL3xGYTQdh+8HgqkJ9Tce7vKBdQwUvO+Tz+v9gqbAcv2+TNpMGnJLwMW4 DAjcBLVU1VGzEuQaPIJCknjESfrFxbd5nidnjR+DZL4gD1xrknIEhUSvEKYW4AmWV0uS 6ZPQ== 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 c1-v6si60887pld.427.2018.02.06.15.12.03; Tue, 06 Feb 2018 15:12:17 -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 S1753740AbeBFXLT (ORCPT + 99 others); Tue, 6 Feb 2018 18:11:19 -0500 Received: from mail-oi0-f68.google.com ([209.85.218.68]:44699 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753515AbeBFXLS (ORCPT ); Tue, 6 Feb 2018 18:11:18 -0500 Received: by mail-oi0-f68.google.com with SMTP id b3so2634049oib.11 for ; Tue, 06 Feb 2018 15:11:18 -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:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=FBJ0wxW2rTGZyE3mVXIvjy2S0zYettb1kNRIQ7v6CIs=; b=WfieDGjCb0PAubFhm0biwqJ6RelBtWRphkrqpuimBYiKn+r2Ubnur6UDTyIbcJT4T8 uzYPc07f2tsrwaZYr8Av65aCXnOnJugGhOYulpWxYsPytN9oRKOUnhw7e5DmxoGZsF7Z p7kniGKDFJUlv6JnkAugQQiZe6LXfAj2GoKRT5VZI6DuIKlMzbkBEMtfiBaqvAeJL6iN t7eOXWLmSuqmyFafoYFb0x6OvOKoJUE1g7I6IvAQ5Rfr57WDPxWZV8zYd7T/x4rbtXVb 5/nNIrkLeqIUh63zzmpmYzx6ACq3yS2ASXmvNcl2hKR1326D5H13IEtI3fQTAS2tvzwf XBSg== X-Gm-Message-State: APf1xPDociWI8zSHSWihGSR6pXXjkirFroXGZcztL0PGnJC9DTa7AhCz YQbWZ9guq+2Idja/HZUm/loub1wd5E0= X-Received: by 10.202.107.194 with SMTP id g185mr2801027oic.268.1517958677509; Tue, 06 Feb 2018 15:11:17 -0800 (PST) Received: from ?IPv6:2601:602:9802:a8dc::f21a? ([2601:602:9802:a8dc::f21a]) by smtp.gmail.com with ESMTPSA id d190sm71374oig.32.2018.02.06.15.11.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Feb 2018 15:11:16 -0800 (PST) Subject: Re: [PATCH 1/2] staging: android: ion: Remove dead code in ion_page_pool_free From: Laura Abbott 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> <6286ae0a-f439-3477-91bb-8df0e454b98e@redhat.com> Message-ID: Date: Tue, 6 Feb 2018 15:11:15 -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: <6286ae0a-f439-3477-91bb-8df0e454b98e@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> 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) >> >