Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1324781pxk; Thu, 10 Sep 2020 12:32:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxi63sP8rPBgv7VX71HnP6kSWRY7HU6BDqTR4d+hwiR9VlRxAA0aJioy4tlURDUyJlq7srM X-Received: by 2002:a17:906:43c9:: with SMTP id j9mr10303624ejn.542.1599766321695; Thu, 10 Sep 2020 12:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599766321; cv=none; d=google.com; s=arc-20160816; b=m9Sho8C5SuPRFgynf7aguCsx/uq0DkUck3CVGKfuVcNOFSWvQ7rYALNbq/kL2f84F3 qZxhVyiGEEqM5rec7GypYxxeGEtReLcLdyQ3+HENBn2Y5qYrgSrAkr4capVmTwD7V7DI TZZcHwpahp2q7oAxthY1VAtRrOwduXsnV7V1YmEY5qa1XWw3EBFJ5SsTbO1Nr5ZSLFWt Bq/BzjAkSJ6TdtNX2O+WuviTMQTkJlQtmDzZvWnehmkhIJgDhqvZ4mz8IPs1DlyK71gR 0Ab4jPV4BikVXfyOsuCx+1DhDTRpskZ82+R9qVBXjd1TQ7E0GuqJCJTvnm4WBnndQR5q zjlQ== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=al6pKOvlvz2J+ErKX1VEEVtEKj9j6vfSObYkA+Ss4zY=; b=YM0I+cHEvA2zf1yqQGhqg2tBdzU7fRykFDyXuHMWNtzcCUOhrYKIM8k01l9fp6s2go FsYpiN4FAINoDGmUGjlC+1CKD3iCLTGh+DFJE0CD6pAGtlW0S05WlWjTa8WFGf/r5jnU 4zrTMCtAHkqK3arjmRGKzMbuJIqC7620oHXNSn111xVLbpP/AgLqVBPH7JTPBXSi8wrK bLG/ujubezy0Xoj9iNAOd/9uVJV2WOcSTACZLzLR+Ns1nuHFgdEkp7hkxBBDL4wstfTb LgEyIDFmBNrWymqufnAn2Zb4TCegWNuDRosEPa279thSQvdmSobdtGYBI1ehi/5UyoJr q7GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RLBqZtOn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k21si4258260eje.480.2020.09.10.12.31.39; Thu, 10 Sep 2020 12:32:01 -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; dkim=pass header.i=@kernel.org header.s=default header.b=RLBqZtOn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727010AbgIJTat (ORCPT + 99 others); Thu, 10 Sep 2020 15:30:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:47882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727943AbgIJT3U (ORCPT ); Thu, 10 Sep 2020 15:29:20 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 077E0207DE; Thu, 10 Sep 2020 19:29:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599766159; bh=xdEi+nnHPoX5+tUHKLW+zfHZQoV5peod/7jyP2Gpm2M=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RLBqZtOnV1AeXSaA467zCMMCU+znsxkYt803axM7g++QJ8p3fwxC9VyJmfswYrA8l bJOgluRzemVb3+QGs8hx+httc+U05KpcvvPbBG+aRmZjznhs0UEfOFVVHc63VY/oFO qLVDZhOitrvd11Sb/WFEArDcs0vQpWck4UBWDb94= Date: Thu, 10 Sep 2020 12:29:12 -0700 From: Jakub Kicinski To: Luo Jiaxing Cc: , , , , , , , Subject: Re: [PATCH net-next] net: stmmac: Remove unused variable 'ret' at stmmac_rx_buf1_len() Message-ID: <20200910122912.5792f657@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <1599705765-15562-1-git-send-email-luojiaxing@huawei.com> References: <1599705765-15562-1-git-send-email-luojiaxing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 10 Sep 2020 10:42:45 +0800 Luo Jiaxing wrote: > Fixes the following warning when using W=3D1 to build kernel: >=20 > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:3634:6: warning: variab= le =E2=80=98ret=E2=80=99 set but not used [-Wunused-but-set-variable] > int ret, coe =3D priv->hw->rx_csum; >=20 > 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. >=20 > Signed-off-by: Luo Jiaxing > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > 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 stm= mac_priv *priv, > struct dma_desc *p, > int status, unsigned int len) > { > - int ret, coe =3D priv->hw->rx_csum; > unsigned int plen =3D 0, hlen =3D 0; > + int coe =3D priv->hw->rx_csum; > =20 > /* Not first descriptor, buffer is always zero */ > if (priv->sph && len) > return 0; > =20 > /* First descriptor, get split header length */ > - ret =3D 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. > if (priv->sph && hlen) { > priv->xstats.rx_split_hdr_pkt_n++; > return hlen;