提交 a77e4acc 编写于 作者: P Pavel Machek 提交者: David S. Miller

stmmac: simple cleanups

This adds simple cleanups for stmmac, removing test we know is always
true, fixing whitespace, and moving code out of if().
Signed-off-by: NPavel Machek <pavel@denx.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b209af99
......@@ -261,11 +261,11 @@ static int stmmac_ethtool_getsettings(struct net_device *dev,
ethtool_cmd_speed_set(cmd, priv->xstats.pcs_speed);
/* Get and convert ADV/LP_ADV from the HW AN registers */
if (priv->hw->mac->get_adv)
priv->hw->mac->get_adv(priv->hw, &adv);
else
if (!priv->hw->mac->get_adv)
return -EOPNOTSUPP; /* should never happen indeed */
priv->hw->mac->get_adv(priv->hw, &adv);
/* Encoding of PSE bits is defined in 802.3z, 37.2.1.4 */
if (adv.pause & STMMAC_PCS_PAUSE)
......@@ -340,7 +340,6 @@ static int stmmac_ethtool_setsettings(struct net_device *dev,
if (cmd->autoneg != AUTONEG_ENABLE)
return -EINVAL;
if (cmd->autoneg == AUTONEG_ENABLE) {
mask &= (ADVERTISED_1000baseT_Half |
ADVERTISED_1000baseT_Full |
ADVERTISED_100baseT_Half |
......@@ -352,7 +351,6 @@ static int stmmac_ethtool_setsettings(struct net_device *dev,
if (priv->hw->mac->ctrl_ane)
priv->hw->mac->ctrl_ane(priv->hw, 1);
spin_unlock(&priv->lock);
}
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册