Subject: Re: [PATCH 30/30] net: ethernet: smsc: smc91x: Mark 'pkt_len' as __maybe_unused

From: Lee Jones <[email-masked]>
Date: Thu, 12 Nov 2020 10:06:58 +0000

On Mon, 02 Nov 2020, Lee Jones wrote:

> 'pkt_len' is used to interact with a hardware register.  It might not
> be safe to remove it entirely.  Mark it as __maybe_unused instead.
> 
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/net/ethernet/smsc/smc91x.c: In function ‘smc_tx’:
>  drivers/net/ethernet/smsc/smc91x.c:706:51: warning: variable ‘pkt_len’ set but not used [-Wunused-but-set-variable]
> 
> Cc: Nicolas Pitre <[email-masked]>
> Cc: "David S. Miller" <[email-masked]>
> Cc: Jakub Kicinski <[email-masked]>
> Cc: Erik Stahlman <[email-masked]>
> Cc: Peter Cammaert <[email-masked]>
> Cc: Daris A Nevil <[email-masked]>
> Cc: Russell King <[email-masked]>
> Cc: [email-masked]
> Signed-off-by: Lee Jones <[email-masked]>
> ---
>  drivers/net/ethernet/smsc/smc91x.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
> index b5d053292e717..a3f37b1f86491 100644
> --- a/drivers/net/ethernet/smsc/smc91x.c
> +++ b/drivers/net/ethernet/smsc/smc91x.c
> @@ -703,7 +703,7 @@ static void smc_tx(struct net_device *dev)
>  {
>  	struct smc_local *lp = netdev_priv(dev);
>  	void __iomem *ioaddr = lp->base;
> -	unsigned int saved_packet, packet_no, tx_status, pkt_len;
> +	unsigned int saved_packet, packet_no, tx_status, __maybe_unused pkt_len;
>  
>  	DBG(3, dev, "%s\n", __func__);

This one is still lingering.  Looks like it's still relevant.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog