diff options
author | Quentin Schulz <quentin.schulz@bootlin.com> | 2018-10-08 12:07:28 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-08 10:29:21 -0700 |
commit | 629ea0f14080ce1393219904ed1ecbaacf70ab22 (patch) | |
tree | 61230379b3ed8284a4260cd4c5927d7cc8ce87e5 /drivers/net | |
parent | 6f0430c78c05ce288f0ead7d440233a0fb9cac31 (diff) |
net: phy: mscc: remove unneeded temporary variable
Here, the rc variable is either used only for the condition right after
the assignment or right before being used as the return value of the
function it's being used in.
So let's remove this unneeded temporary variable whenever possible.
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/phy/mscc.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c index 6bfdc168c62b..7ae3e644a18f 100644 --- a/drivers/net/phy/mscc.c +++ b/drivers/net/phy/mscc.c @@ -481,7 +481,7 @@ out_unlock: static int vsc85xx_edge_rate_magic_get(struct phy_device *phydev) { u32 vdd, sd; - int rc, i, j; + int i, j; struct device *dev = &phydev->mdio.dev; struct device_node *of_node = dev->of_node; u8 sd_array_size = ARRAY_SIZE(edge_table[0].slowdown); @@ -489,12 +489,10 @@ static int vsc85xx_edge_rate_magic_get(struct phy_device *phydev) if (!of_node) return -ENODEV; - rc = of_property_read_u32(of_node, "vsc8531,vddmac", &vdd); - if (rc != 0) + if (of_property_read_u32(of_node, "vsc8531,vddmac", &vdd)) vdd = MSCC_VDDMAC_3300; - rc = of_property_read_u32(of_node, "vsc8531,edge-slowdown", &sd); - if (rc != 0) + if (of_property_read_u32(of_node, "vsc8531,edge-slowdown", &sd)) sd = 0; for (i = 0; i < ARRAY_SIZE(edge_table); i++) @@ -735,9 +733,7 @@ static int vsc85xx_config_init(struct phy_device *phydev) return rc; } - rc = genphy_config_init(phydev); - - return rc; + return genphy_config_init(phydev); } static int vsc85xx_ack_interrupt(struct phy_device *phydev) |