Skip to content

Commit

Permalink
liquidio: fix duplicated code for different branches
Browse files Browse the repository at this point in the history
Refactor code in order to avoid identical code for different branches.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Gustavo A. R. Silva authored and David S. Miller committed Aug 14, 2017
1 parent da1542b commit b5e7dc4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions drivers/net/ethernet/cavium/liquidio/lio_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,23 +578,18 @@ static int lio_set_phys_id(struct net_device *netdev,
break;

case ETHTOOL_ID_ON:
if (oct->chip_id == OCTEON_CN66XX) {
if (oct->chip_id == OCTEON_CN66XX)
octnet_gpio_access(netdev, VITESSE_PHY_GPIO_CFG,
VITESSE_PHY_GPIO_HIGH);

} else if (oct->chip_id == OCTEON_CN68XX) {
return -EINVAL;
} else {
else
return -EINVAL;
}

break;

case ETHTOOL_ID_OFF:
if (oct->chip_id == OCTEON_CN66XX)
octnet_gpio_access(netdev, VITESSE_PHY_GPIO_CFG,
VITESSE_PHY_GPIO_LOW);
else if (oct->chip_id == OCTEON_CN68XX)
return -EINVAL;
else
return -EINVAL;

Expand Down

0 comments on commit b5e7dc4

Please sign in to comment.