Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1579427pxk; Thu, 10 Sep 2020 20:58:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzL3lWFWgmbNHqjmG/bBn9xeZADtAYDgLU/LvKKIs8Ch2KimhNHpXGOMZFk6cu0uB/xVb9X X-Received: by 2002:a17:906:95d1:: with SMTP id n17mr194095ejy.324.1599796733325; Thu, 10 Sep 2020 20:58:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599796733; cv=none; d=google.com; s=arc-20160816; b=ISkTeeXudipGh78J4AMGZtMmqqfyH0RxCSGVkKcBynOmTkmPNLhXTolmVERVRsio6T J6qBLrMbk7UMbVmd3TBcln267cbIfZ4opZY22wCRHUDhuX7GmCBFcXX7x+m0dP0Xph3z oJAo80ElDQoVe5lwynGtYSl3S66AjU3Y9EqTaToiA/7nhwcyTvbxrIbJxfgpzuaUOroL o6n0PT8kaM5iFiZPmD1dhVYppug/UH15expoO9JfTji6XOAH0iTeCzhA2tt98J26Rx4u avDxNbg5wnOhzp8POvF0s8tqtM2ZDcu3TxqX3hEJBzVNyZ5xYthMbvokq0wehuk0mfxS QRcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=un+7NbYAEapkKaXmA16mgWlxLo5w48o4oeKA/grEMUg=; b=Ci7KTqqE0fH8KK90DfV0pvTFNy2dYPB00M/GKAvxal4A1TxbgoYli1d3P/UBqgi8cV 2gzm1bWp9LgyD51LnmT17bD4c0Zo3goR4fX/INQ4WP9R8qsw3IQ9DweGEqAzTERak884 j8xkVvgxlzPiqma0mt+EP4vdUhcLJsunXRrDAhEnSIH/f6HUfrV5BK9LTlTyYISLeySq 91vWLCLYmkkszr5Ub3MkemQPTQ6vBtUZb1y+C5jE2nVGW0Tn4VpByqAMbaIBYF7ArlHE PgtxLqKpnQpO8x1roy6lCnLsMqxB3nEO+BmLeI3+8NyS0atOpVKusFMjnFQzwLjflvh+ dHGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c6si469027edq.397.2020.09.10.20.58.30; Thu, 10 Sep 2020 20:58:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725616AbgIKD5R (ORCPT + 99 others); Thu, 10 Sep 2020 23:57:17 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:11810 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725283AbgIKD5R (ORCPT ); Thu, 10 Sep 2020 23:57:17 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 3389ACA3CCD13B1B6CFA; Fri, 11 Sep 2020 11:57:15 +0800 (CST) Received: from [127.0.0.1] (10.57.22.126) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Fri, 11 Sep 2020 11:57:06 +0800 Subject: Re: [PATCH net-next] net: stmmac: Remove unused variable 'ret' at stmmac_rx_buf1_len() To: Jakub Kicinski CC: , , , , , , , References: <1599705765-15562-1-git-send-email-luojiaxing@huawei.com> <20200910122912.5792f657@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> From: luojiaxing Message-ID: Date: Fri, 11 Sep 2020 11:57:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20200910122912.5792f657@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.57.22.126] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/9/11 3:29, Jakub Kicinski wrote: > On Thu, 10 Sep 2020 10:42:45 +0800 Luo Jiaxing wrote: >> Fixes the following warning when using W=1 to build kernel: >> >> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:3634:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] >> int ret, coe = priv->hw->rx_csum; >> >> When digging stmmac_get_rx_header_len(), dwmac4_get_rx_header_len() and >> dwxgmac2_get_rx_header_len() return 0 by default. Therefore, ret do not >> need to check the error value and can be directly deleted. >> >> Signed-off-by: Luo Jiaxing >> --- >> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> index 89b2b34..7e95412 100644 >> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> @@ -3631,15 +3631,15 @@ static unsigned int stmmac_rx_buf1_len(struct stmmac_priv *priv, >> struct dma_desc *p, >> int status, unsigned int len) >> { >> - int ret, coe = priv->hw->rx_csum; >> unsigned int plen = 0, hlen = 0; >> + int coe = priv->hw->rx_csum; >> >> /* Not first descriptor, buffer is always zero */ >> if (priv->sph && len) >> return 0; >> >> /* First descriptor, get split header length */ >> - ret = stmmac_get_rx_header_len(priv, p, &hlen); >> + stmmac_get_rx_header_len(priv, p, &hlen); > This function should return void if there never are any errors to > report. Yes, you are right. So, if we need to modify the function type , this patch need to be drop. And I will send a new patch later to redefine get_rx_header_len() to void and delete ret there. Please check "net: stmmac: set get_rx_header_len() as void for it didn't have any error code to return" later. Thanks Jiaxing >> if (priv->sph && hlen) { >> priv->xstats.rx_split_hdr_pkt_n++; >> return hlen; > > . >