Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp768979pxk; Wed, 9 Sep 2020 19:49:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzynzKfAJdHV/D6xS1vZPdNKXbcvUhzeuWtwpos2npf4XRn1EU1Gp1B8ZH7TwUZIo9+XYsd X-Received: by 2002:a17:906:841a:: with SMTP id n26mr6493886ejx.213.1599706175986; Wed, 09 Sep 2020 19:49:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599706175; cv=none; d=google.com; s=arc-20160816; b=bPUYLE/Ki2jTmGPo+PC0oV503F9FvvEKo4beLq22+2lMKAiRjdSYC4tvLg8dbqXr25 ZDMjQrsjAcblKqzrNTQQJA8R0D8t5RZM32XxER1aFom30RJFn+nth/SuZYtJNmF/3nby K/4ZjAyRieSBLYzbhhIOMW40l4zYS6N6xcxSYrcvZ9Tj0QFgIv1mY+lCLbK4eOLte03D fsfck2gJGWLYqDTxL9vAPYTI5KvqrLq4c2hJ1armLQVlSCNnLAmbhQhuOSV+cPWQxMwi KWlonJhMcPaa2YQnqpfGDrsdKVfC/9GdMjIoJCdaZ6b0I5J0tGoeCxXEGpVpHm4/HclL erfw== 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 :message-id:date:subject:cc:to:from; bh=zF6NVptPY3ZlE16Obx2MPbg3++a5aRKlJpViJ/mBSwY=; b=KhNWTdpgjlLkLtw0R5k+M+3d0gdkXEX0WSgm2aYxa8pHxoqWlUtkOno3vrIVb1H1H7 OIY4TqRAhauLpoTB/gvBwKeyNgwB24+HWu+zzSTVnqTDRjJSE9MzCl291d2jnLApkFqT Jm3CPWwSEpNe0OrvgoZY/sxkImVeTRBI59tdAGKkmPwAI9+VVi0XfCPg5cghFfXLL6xu 9ctDgSCUPHJI0fsVbYCLH2YmUjuLA0TReMyvj4InEzLr61poF1yVJ8hCDaoFZXRolQ96 qQEZmHZS+vjxNXMyFNe0oenQJW/EXnjt1jIddtK3sIB8v96wUPPkO//UWzwqVoXmfMOd 8gPg== 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 w14si2768305edx.50.2020.09.09.19.49.13; Wed, 09 Sep 2020 19:49:35 -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 S1730434AbgIJCqm (ORCPT + 99 others); Wed, 9 Sep 2020 22:46:42 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:11329 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730500AbgIJCpb (ORCPT ); Wed, 9 Sep 2020 22:45:31 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id F250F7A3B6D568484089; Thu, 10 Sep 2020 10:45:12 +0800 (CST) Received: from huawei.com (10.69.192.56) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Thu, 10 Sep 2020 10:45:03 +0800 From: Luo Jiaxing To: , , , , , CC: , , Subject: [PATCH net-next] net: stmmac: Remove unused variable 'ret' at stmmac_rx_buf1_len() Date: Thu, 10 Sep 2020 10:42:45 +0800 Message-ID: <1599705765-15562-1-git-send-email-luojiaxing@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); if (priv->sph && hlen) { priv->xstats.rx_split_hdr_pkt_n++; return hlen; -- 2.7.4