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 protected]>
> Cc: "David S. Miller" <[email protected]>
> Cc: Jakub Kicinski <[email protected]>
> Cc: Erik Stahlman <[email protected]>
> Cc: Peter Cammaert <[email protected]>
> Cc: Daris A Nevil <[email protected]>
> Cc: Russell King <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
>  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

Reply via email to