diff mbox series

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

Message ID 20201102114512.1062724-31-lee.jones@linaro.org
State New
Headers show
Series [01/30] net: fddi: skfp: ecm: Protect 'if' when AIX_EVENT is not defined | expand

Commit Message

Lee Jones Nov. 2, 2020, 11:45 a.m. UTC
'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 <nico@fluxnic.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Erik Stahlman <erik@vt.edu>
Cc: Peter Cammaert <pc@denkart.be>
Cc: Daris A Nevil <dnevil@snmc.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: netdev@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>

---
 drivers/net/ethernet/smsc/smc91x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.25.1

Comments

Lee Jones Nov. 12, 2020, 10:06 a.m. UTC | #1
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 <nico@fluxnic.net>

> Cc: "David S. Miller" <davem@davemloft.net>

> Cc: Jakub Kicinski <kuba@kernel.org>

> Cc: Erik Stahlman <erik@vt.edu>

> Cc: Peter Cammaert <pc@denkart.be>

> Cc: Daris A Nevil <dnevil@snmc.com>

> Cc: Russell King <rmk@arm.linux.org.uk>

> Cc: netdev@vger.kernel.org

> Signed-off-by: Lee Jones <lee.jones@linaro.org>

> ---

>  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
Andrew Lunn Nov. 12, 2020, 4:18 p.m. UTC | #2
> This one is still lingering.  Looks like it's still relevant.


Hi Lee

It is part of this patchset:

https://www.mail-archive.com/netdev@vger.kernel.org/msg368589.html

	Andrew
diff mbox series

Patch

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__);