linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: remove variable 'ret' set but not used
@ 2019-11-16  3:50 Chen Wandun
  2019-11-16 21:14 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Wandun @ 2019-11-16  3:50 UTC (permalink / raw)
  To: davem, joabreu, netdev, linux-stm32, linux-arm-kernel, linux-kernel
  Cc: chenwandun

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function stmmac_rx_buf1_len:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:3460:6: warning: variable ret set but not used [-Wunused-but-set-variable]

Signed-off-by: Chen Wandun <chenwandun@huawei.com>
---
 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 39b4efd..7003a30 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3457,7 +3457,7 @@ 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;
+	int coe = priv->hw->rx_csum;
 	unsigned int plen = 0, hlen = 0;
 
 	/* Not first descriptor, buffer is always zero */
@@ -3465,7 +3465,7 @@ static unsigned int stmmac_rx_buf1_len(struct stmmac_priv *priv,
 		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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: stmmac: remove variable 'ret' set but not used
  2019-11-16  3:50 [PATCH] net: stmmac: remove variable 'ret' set but not used Chen Wandun
@ 2019-11-16 21:14 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-11-16 21:14 UTC (permalink / raw)
  To: chenwandun; +Cc: joabreu, netdev, linux-stm32, linux-arm-kernel, linux-kernel

From: Chen Wandun <chenwandun@huawei.com>
Date: Sat, 16 Nov 2019 11:50:46 +0800

> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function stmmac_rx_buf1_len:
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:3460:6: warning: variable ret set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Chen Wandun <chenwandun@huawei.com>
> ---
>  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 39b4efd..7003a30 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -3457,7 +3457,7 @@ 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;
> +	int coe = priv->hw->rx_csum;
>  	unsigned int plen = 0, hlen = 0;

You are breaking the reverse christmas tree ordering of the local
variables here, please don't do that.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-16 21:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-16  3:50 [PATCH] net: stmmac: remove variable 'ret' set but not used Chen Wandun
2019-11-16 21:14 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).