Kill unneeded local variables in the LXT PHY driver
Subsystems (3)
cover Kill unneeded local variables in the LXT PHY driver
Hello.
[Resending with the correct subject. Sorry about that :-/]
Here's the set of 2 patches against DaveM's 'net-next.git' repo. We save
several LoCs on the unneeded local variables....
[1/2] lxt: simplify lxt97[01]_config_intr()
[2/2] lxt: simplify lxt970_config_init()
MBR, Sergei
PATCH 1/2 lxt: simplify lxt97[01]_config_intr()
Both these functions declare the 'err' local variables for no good reason, get rid of them.
Signed-off-by Sergei Shtylyov <[email protected]>
--- drivers/net/phy/lxt.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/net/phy/lxt.c +4 -12
@@ -80,14 +80,10 @@ static int lxt970_ack_interrupt(struct pstatic int lxt970_config_intr (struct phy_device *phydev) { -int err; -if (phydev->interrupts ==PHY_INTERRUPT_ENABLED ) - err =phy_write (phydev,MII_LXT970_IER ,MII_LXT970_IER_IEN ); +return phy_write (phydev,MII_LXT970_IER ,MII_LXT970_IER_IEN );else - err =phy_write (phydev,MII_LXT970_IER ,0 ); - -return err; +return phy_write (phydev,MII_LXT970_IER ,0 ); }static int lxt970_config_init (struct phy_device *phydev)
@@ -112,14 +108,10 @@ static int lxt971_ack_interrupt(struct pstatic int lxt971_config_intr (struct phy_device *phydev) { -int err; -if (phydev->interrupts ==PHY_INTERRUPT_ENABLED ) - err =phy_write (phydev,MII_LXT971_IER ,MII_LXT971_IER_IEN ); +return phy_write (phydev,MII_LXT971_IER ,MII_LXT971_IER_IEN );else - err =phy_write (phydev,MII_LXT971_IER ,0 ); - -return err; +return phy_write (phydev,MII_LXT971_IER ,0 ); }/*
PATCH 2/2 lxt: simplify lxt970_config_init()
In reply to Sergei ShtylyovThis function declares the 'err' local variable for no good reason, get rid of it.
Signed-off-by Sergei Shtylyov <[email protected]>
--- drivers/net/phy/lxt.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/phy/lxt.c +1 -5
@@ -88,11 +88,7 @@ static int lxt970_config_intr(struct phystatic int lxt970_config_init (struct phy_device *phydev) { -int err; - - err =phy_write (phydev,MII_LXT970_CONFIG ,0 ); - -return err; +return phy_write (phydev,MII_LXT970_CONFIG ,0 ); }