Commit 629ea0f1 authored by Quentin Schulz's avatar Quentin Schulz Committed by David S. Miller

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: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarQuentin Schulz <quentin.schulz@bootlin.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6f0430c7
...@@ -481,7 +481,7 @@ static void vsc85xx_wol_get(struct phy_device *phydev, ...@@ -481,7 +481,7 @@ static void vsc85xx_wol_get(struct phy_device *phydev,
static int vsc85xx_edge_rate_magic_get(struct phy_device *phydev) static int vsc85xx_edge_rate_magic_get(struct phy_device *phydev)
{ {
u32 vdd, sd; u32 vdd, sd;
int rc, i, j; int i, j;
struct device *dev = &phydev->mdio.dev; struct device *dev = &phydev->mdio.dev;
struct device_node *of_node = dev->of_node; struct device_node *of_node = dev->of_node;
u8 sd_array_size = ARRAY_SIZE(edge_table[0].slowdown); 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) ...@@ -489,12 +489,10 @@ static int vsc85xx_edge_rate_magic_get(struct phy_device *phydev)
if (!of_node) if (!of_node)
return -ENODEV; return -ENODEV;
rc = of_property_read_u32(of_node, "vsc8531,vddmac", &vdd); if (of_property_read_u32(of_node, "vsc8531,vddmac", &vdd))
if (rc != 0)
vdd = MSCC_VDDMAC_3300; vdd = MSCC_VDDMAC_3300;
rc = of_property_read_u32(of_node, "vsc8531,edge-slowdown", &sd); if (of_property_read_u32(of_node, "vsc8531,edge-slowdown", &sd))
if (rc != 0)
sd = 0; sd = 0;
for (i = 0; i < ARRAY_SIZE(edge_table); i++) for (i = 0; i < ARRAY_SIZE(edge_table); i++)
...@@ -735,9 +733,7 @@ static int vsc85xx_config_init(struct phy_device *phydev) ...@@ -735,9 +733,7 @@ static int vsc85xx_config_init(struct phy_device *phydev)
return rc; return rc;
} }
rc = genphy_config_init(phydev); return genphy_config_init(phydev);
return rc;
} }
static int vsc85xx_ack_interrupt(struct phy_device *phydev) static int vsc85xx_ack_interrupt(struct phy_device *phydev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment