[PATCH 02/12] net: ethernet: smsc: smc911x: Mark 'status' as __maybe_unused

From: Lee Jones
Date: Wed Nov 04 2020 - 04:06:36 EST


'status' 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/smc911x.c: In function ‘smc911x_phy_configure’:
drivers/net/ethernet/smsc/smc911x.c:882:6: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
drivers/net/ethernet/smsc/smc911x.c: In function ‘smc911x_phy_interrupt’:
drivers/net/ethernet/smsc/smc911x.c:976:6: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
drivers/net/ethernet/smsc/smc911x.c: In function ‘smc911x_timeout’:
drivers/net/ethernet/smsc/smc911x.c:1251:6: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]

Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
Cc: Jakub Kicinski <kuba@xxxxxxxxxx>
Cc: Dustin McIntire <dustin@xxxxxxxxxxxx>
Cc: netdev@xxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>
---
drivers/net/ethernet/smsc/smc911x.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c
index 01069dfaf75c9..552953c376fe3 100644
--- a/drivers/net/ethernet/smsc/smc911x.c
+++ b/drivers/net/ethernet/smsc/smc911x.c
@@ -879,7 +879,7 @@ static void smc911x_phy_configure(struct work_struct *work)
int phyaddr = lp->mii.phy_id;
int my_phy_caps; /* My PHY capabilities */
int my_ad_caps; /* My Advertised capabilities */
- int status;
+ int __maybe_unused status;
unsigned long flags;

DBG(SMC_DEBUG_FUNC, dev, "--> %s()\n", __func__);
@@ -973,7 +973,7 @@ static void smc911x_phy_interrupt(struct net_device *dev)
{
struct smc911x_local *lp = netdev_priv(dev);
int phyaddr = lp->mii.phy_id;
- int status;
+ int __maybe_unused status;

DBG(SMC_DEBUG_FUNC, dev, "--> %s\n", __func__);

@@ -1248,7 +1248,7 @@ static void smc911x_poll_controller(struct net_device *dev)
static void smc911x_timeout(struct net_device *dev, unsigned int txqueue)
{
struct smc911x_local *lp = netdev_priv(dev);
- int status, mask;
+ int __maybe_unused status, mask;
unsigned long flags;

DBG(SMC_DEBUG_FUNC, dev, "--> %s\n", __func__);
--
2.25.1