* [PATCH 0/2] Kill unneeded local variables in the LXT PHY driver
@ 2016-05-13 23:07 Sergei Shtylyov
2016-05-13 23:08 ` [PATCH 1/2] lxt: simplify lxt97[01]_config_intr() Sergei Shtylyov
2016-05-13 23:09 ` [PATCH 2/2] lxt: simplify lxt970_config_init() Sergei Shtylyov
0 siblings, 2 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2016-05-13 23:07 UTC (permalink / raw)
To: f.fainelli, netdev
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] lxt: simplify lxt97[01]_config_intr()
2016-05-13 23:07 [PATCH 0/2] Kill unneeded local variables in the LXT PHY driver Sergei Shtylyov
@ 2016-05-13 23:08 ` Sergei Shtylyov
2016-05-13 23:09 ` [PATCH 2/2] lxt: simplify lxt970_config_init() Sergei Shtylyov
1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2016-05-13 23:08 UTC (permalink / raw)
To: f.fainelli, netdev
Both these functions declare the 'err' local variables for no good reason,
get rid of them.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
drivers/net/phy/lxt.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
Index: net-next/drivers/net/phy/lxt.c
===================================================================
--- net-next.orig/drivers/net/phy/lxt.c
+++ net-next/drivers/net/phy/lxt.c
@@ -80,14 +80,10 @@ static int lxt970_ack_interrupt(struct p
static 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 p
static 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);
}
/*
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] lxt: simplify lxt970_config_init()
2016-05-13 23:07 [PATCH 0/2] Kill unneeded local variables in the LXT PHY driver Sergei Shtylyov
2016-05-13 23:08 ` [PATCH 1/2] lxt: simplify lxt97[01]_config_intr() Sergei Shtylyov
@ 2016-05-13 23:09 ` Sergei Shtylyov
1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2016-05-13 23:09 UTC (permalink / raw)
To: f.fainelli, netdev
This function declares the 'err' local variable for no good reason, get rid
of it.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
drivers/net/phy/lxt.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
Index: net-next/drivers/net/phy/lxt.c
===================================================================
--- net-next.orig/drivers/net/phy/lxt.c
+++ net-next/drivers/net/phy/lxt.c
@@ -88,11 +88,7 @@ static int lxt970_config_intr(struct phy
static 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);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-05-13 23:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-13 23:07 [PATCH 0/2] Kill unneeded local variables in the LXT PHY driver Sergei Shtylyov
2016-05-13 23:08 ` [PATCH 1/2] lxt: simplify lxt97[01]_config_intr() Sergei Shtylyov
2016-05-13 23:09 ` [PATCH 2/2] lxt: simplify lxt970_config_init() Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).