netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Fugang Duan <fugang.duan@nxp.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Greg Ungerer <gerg@linux-m68k.org>,
	netdev@vger.kernel.org, linux-m68k@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: fec: Silence M5272 build warnings
Date: Tue, 2 Feb 2021 08:27:59 -0800	[thread overview]
Message-ID: <20210202162759.GD159455@roeck-us.net> (raw)
In-Reply-To: <20210202130650.865023-1-geert@linux-m68k.org>

On Tue, Feb 02, 2021 at 02:06:50PM +0100, Geert Uytterhoeven wrote:
> If CONFIG_M5272=y:
> 
>     drivers/net/ethernet/freescale/fec_main.c: In function ‘fec_restart’:
>     drivers/net/ethernet/freescale/fec_main.c:948:6: warning: unused variable ‘val’ [-Wunused-variable]
>       948 |  u32 val;
> 	  |      ^~~
>     drivers/net/ethernet/freescale/fec_main.c: In function ‘fec_get_mac’:
>     drivers/net/ethernet/freescale/fec_main.c:1667:28: warning: unused variable ‘pdata’ [-Wunused-variable]
>      1667 |  struct fec_platform_data *pdata = dev_get_platdata(&fep->pdev->dev);
> 	  |                            ^~~~~
> 
> Fix this by moving the variable declarations inside the existing #ifdef
> blocks.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/net/ethernet/freescale/fec_main.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index 9ebdb0e54291b204..3db882322b2bd3e8 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -945,7 +945,6 @@ static void
>  fec_restart(struct net_device *ndev)
>  {
>  	struct fec_enet_private *fep = netdev_priv(ndev);
> -	u32 val;
>  	u32 temp_mac[2];
>  	u32 rcntl = OPT_FRAME_SIZE | 0x04;
>  	u32 ecntl = 0x2; /* ETHEREN */
> @@ -997,7 +996,8 @@ fec_restart(struct net_device *ndev)
>  
>  #if !defined(CONFIG_M5272)
>  	if (fep->quirks & FEC_QUIRK_HAS_RACC) {
> -		val = readl(fep->hwp + FEC_RACC);
> +		u32 val = readl(fep->hwp + FEC_RACC);
> +
>  		/* align IP header */
>  		val |= FEC_RACC_SHIFT16;
>  		if (fep->csum_flags & FLAG_RX_CSUM_ENABLED)
> @@ -1664,7 +1664,6 @@ static int fec_enet_rx_napi(struct napi_struct *napi, int budget)
>  static void fec_get_mac(struct net_device *ndev)
>  {
>  	struct fec_enet_private *fep = netdev_priv(ndev);
> -	struct fec_platform_data *pdata = dev_get_platdata(&fep->pdev->dev);
>  	unsigned char *iap, tmpaddr[ETH_ALEN];
>  
>  	/*
> @@ -1695,6 +1694,8 @@ static void fec_get_mac(struct net_device *ndev)
>  		if (FEC_FLASHMAC)
>  			iap = (unsigned char *)FEC_FLASHMAC;
>  #else
> +		struct fec_platform_data *pdata = dev_get_platdata(&fep->pdev->dev);
> +
>  		if (pdata)
>  			iap = (unsigned char *)&pdata->mac;
>  #endif
> -- 
> 2.25.1
> 

  reply	other threads:[~2021-02-02 16:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 13:06 [PATCH] net: fec: Silence M5272 build warnings Geert Uytterhoeven
2021-02-02 16:27 ` Guenter Roeck [this message]
2021-02-03  3:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210202162759.GD159455@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=davem@davemloft.net \
    --cc=fugang.duan@nxp.com \
    --cc=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).