Skip to contentSkip to conversation

stmmac: Remove spin_lock call in stmmac_get_pauseparam()

PATCH In review Emil Goode 2 participants 2 messages Jun 2, 2014

Subsystems (5)
lore
Share & tools
lore

Emil Goode

author
#0 lore raw

PATCH 1/1 stmmac: Remove spin_lock call in stmmac_get_pauseparam()

The following patch removed unnecessary spin_lock/unlock calls in ethtool_ops callback functions. In the second and final version of the patch one spin_lock call was left behind.

commit cab6715c3e8029e98b0b5d4056ceda007c0f6380

Author: Yang Wei <[email protected]>
Date:   Sun May 25 09:53:44 2014 +0800

net: driver: stmicro: Remove some useless the lock protection

This introduced the following sparse warning:

drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:424:1: warning:
context imbalance in 'stmmac_get_pauseparam' - different lock contexts for basic block

---
Hello,

Some spin_lock/unlock calls where also left behind in stmmac_ethtool_setsettings(), I'm not sure if it was intentional?

Best regards,

Emil Goode

 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +0 -2
index 7892666..c62e67f 100644
@@ -429,8 +429,6 @@ stmmac_get_pauseparam(struct net_device *netdev,
 	if (priv->pcs)	/* FIXME */
 		return;
 
-	spin_lock(&priv->lock);
-
 	pause->rx_pause = 0;
 	pause->tx_pause = 0;
 	pause->autoneg = priv->phydev->autoneg;
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw

From: Emil Goode <[email protected]>
Date: Mon, 2 Jun 2014 11:30:50 +0200

Quoted 10 lines

The following patch removed unnecessary spin_lock/unlock calls in ethtool_ops callback functions. In the second and final version of the patch one spin_lock call was left behind.

commit cab6715c3e8029e98b0b5d4056ceda007c0f6380

Author: Yang Wei <[email protected]>
Date:   Sun May 25 09:53:44 2014 +0800

net: driver: stmicro: Remove some useless the lock protection

Quoted 7 lines

This introduced the following sparse warning:

drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:424:1: warning:
context imbalance in 'stmmac_get_pauseparam' - different lock contexts for basic block

Good catch, applied, thanks Emil.