lkml.org 
[lkml]   [2019]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net: stmmac: remove variable 'ret' set but not used
From
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.

\
 
 \ /
  Last update: 2019-11-16 22:15    [W:0.049 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site