Commit cc26dc67 authored by LABBE Corentin's avatar LABBE Corentin Committed by David S. Miller

net: stmmac: reduce indentation by adding a continue

As suggested by Joe Perches, replacing the "if phydev" logic permit to
reduce indentation in the for loop.
Signed-off-by: default avatarCorentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Reviewed-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9beae261
...@@ -247,50 +247,48 @@ int stmmac_mdio_register(struct net_device *ndev) ...@@ -247,50 +247,48 @@ int stmmac_mdio_register(struct net_device *ndev)
found = 0; found = 0;
for (addr = 0; addr < PHY_MAX_ADDR; addr++) { for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
struct phy_device *phydev = mdiobus_get_phy(new_bus, addr); struct phy_device *phydev = mdiobus_get_phy(new_bus, addr);
int act = 0;
char irq_num[4];
char *irq_str;
if (!phydev)
continue;
/*
* If an IRQ was provided to be assigned after
* the bus probe, do it here.
*/
if (!mdio_bus_data->irqs &&
(mdio_bus_data->probed_phy_irq > 0)) {
new_bus->irq[addr] = mdio_bus_data->probed_phy_irq;
phydev->irq = mdio_bus_data->probed_phy_irq;
}
if (phydev) { /*
int act = 0; * If we're going to bind the MAC to this PHY bus,
char irq_num[4]; * and no PHY number was provided to the MAC,
char *irq_str; * use the one probed here.
*/
/* if (priv->plat->phy_addr == -1)
* If an IRQ was provided to be assigned after priv->plat->phy_addr = addr;
* the bus probe, do it here.
*/ act = (priv->plat->phy_addr == addr);
if (!mdio_bus_data->irqs && switch (phydev->irq) {
(mdio_bus_data->probed_phy_irq > 0)) { case PHY_POLL:
new_bus->irq[addr] = irq_str = "POLL";
mdio_bus_data->probed_phy_irq; break;
phydev->irq = mdio_bus_data->probed_phy_irq; case PHY_IGNORE_INTERRUPT:
} irq_str = "IGNORE";
break;
/* default:
* If we're going to bind the MAC to this PHY bus, sprintf(irq_num, "%d", phydev->irq);
* and no PHY number was provided to the MAC, irq_str = irq_num;
* use the one probed here. break;
*/
if (priv->plat->phy_addr == -1)
priv->plat->phy_addr = addr;
act = (priv->plat->phy_addr == addr);
switch (phydev->irq) {
case PHY_POLL:
irq_str = "POLL";
break;
case PHY_IGNORE_INTERRUPT:
irq_str = "IGNORE";
break;
default:
sprintf(irq_num, "%d", phydev->irq);
irq_str = irq_num;
break;
}
netdev_info(ndev, "PHY ID %08x at %d IRQ %s (%s)%s\n",
phydev->phy_id, addr,
irq_str, phydev_name(phydev),
act ? " active" : "");
found = 1;
} }
netdev_info(ndev, "PHY ID %08x at %d IRQ %s (%s)%s\n",
phydev->phy_id, addr, irq_str, phydev_name(phydev),
act ? " active" : "");
found = 1;
} }
if (!found && !mdio_node) { if (!found && !mdio_node) {
......
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