net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void

Make return value void since functions never returns meaningfull value.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
yuval.shaia@oracle.com 2017-06-04 20:22:00 +03:00 committed by David S. Miller
parent c7c6b8715a
commit 82c01a84d5
29 changed files with 78 additions and 73 deletions

View File

@ -1417,10 +1417,9 @@ static int e100_get_link_ksettings(struct net_device *dev,
{
struct net_local *np = netdev_priv(dev);
u32 supported;
int err;
spin_lock_irq(&np->lock);
err = mii_ethtool_get_link_ksettings(&np->mii_if, cmd);
mii_ethtool_get_link_ksettings(&np->mii_if, cmd);
spin_unlock_irq(&np->lock);
/* The PHY may support 1000baseT, but the Etrax100 does not. */
@ -1432,7 +1431,7 @@ static int e100_get_link_ksettings(struct net_device *dev,
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
supported);
return err;
return 0;
}
static int e100_set_link_ksettings(struct net_device *dev,

View File

@ -2912,7 +2912,9 @@ static int vortex_get_link_ksettings(struct net_device *dev,
{
struct vortex_private *vp = netdev_priv(dev);
return mii_ethtool_get_link_ksettings(&vp->mii, cmd);
mii_ethtool_get_link_ksettings(&vp->mii, cmd);
return 0;
}
static int vortex_set_link_ksettings(struct net_device *dev,

View File

@ -731,12 +731,10 @@ static int pcnet32_get_link_ksettings(struct net_device *dev,
{
struct pcnet32_private *lp = netdev_priv(dev);
unsigned long flags;
int r = -EOPNOTSUPP;
spin_lock_irqsave(&lp->lock, flags);
if (lp->mii) {
mii_ethtool_get_link_ksettings(&lp->mii_if, cmd);
r = 0;
} else if (lp->chip_version == PCNET32_79C970A) {
if (lp->autoneg) {
cmd->base.autoneg = AUTONEG_ENABLE;
@ -753,10 +751,9 @@ static int pcnet32_get_link_ksettings(struct net_device *dev,
ethtool_convert_legacy_u32_to_link_mode(
cmd->link_modes.supported,
SUPPORTED_TP | SUPPORTED_AUI);
r = 0;
}
spin_unlock_irqrestore(&lp->lock, flags);
return r;
return 0;
}
static int pcnet32_set_link_ksettings(struct net_device *dev,

View File

@ -702,7 +702,10 @@ static int ep93xx_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct ep93xx_priv *ep = netdev_priv(dev);
return mii_ethtool_get_link_ksettings(&ep->mii, cmd);
mii_ethtool_get_link_ksettings(&ep->mii, cmd);
return 0;
}
static int ep93xx_set_link_ksettings(struct net_device *dev,

View File

@ -1395,13 +1395,12 @@ static int netdev_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct netdev_private *np = netdev_priv(dev);
int rc;
spin_lock_irq(&np->lock);
rc = mii_ethtool_get_link_ksettings(&np->mii_if, cmd);
mii_ethtool_get_link_ksettings(&np->mii_if, cmd);
spin_unlock_irq(&np->lock);
return rc;
return 0;
}
static int netdev_set_link_ksettings(struct net_device *dev,

View File

@ -829,7 +829,10 @@ static int ftmac100_get_link_ksettings(struct net_device *netdev,
struct ethtool_link_ksettings *cmd)
{
struct ftmac100 *priv = netdev_priv(netdev);
return mii_ethtool_get_link_ksettings(&priv->mii, cmd);
mii_ethtool_get_link_ksettings(&priv->mii, cmd);
return 0;
}
static int ftmac100_set_link_ksettings(struct net_device *netdev,

View File

@ -1821,13 +1821,12 @@ static int netdev_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct netdev_private *np = netdev_priv(dev);
int rc;
spin_lock_irq(&np->lock);
rc = mii_ethtool_get_link_ksettings(&np->mii, cmd);
mii_ethtool_get_link_ksettings(&np->mii, cmd);
spin_unlock_irq(&np->lock);
return rc;
return 0;
}
static int netdev_set_link_ksettings(struct net_device *dev,

View File

@ -2430,7 +2430,10 @@ static int e100_get_link_ksettings(struct net_device *netdev,
struct ethtool_link_ksettings *cmd)
{
struct nic *nic = netdev_priv(netdev);
return mii_ethtool_get_link_ksettings(&nic->mii, cmd);
mii_ethtool_get_link_ksettings(&nic->mii, cmd);
return 0;
}
static int e100_set_link_ksettings(struct net_device *netdev,

View File

@ -2610,12 +2610,11 @@ jme_get_link_ksettings(struct net_device *netdev,
struct ethtool_link_ksettings *cmd)
{
struct jme_adapter *jme = netdev_priv(netdev);
int rc;
spin_lock_bh(&jme->phy_lock);
rc = mii_ethtool_get_link_ksettings(&jme->mii_if, cmd);
mii_ethtool_get_link_ksettings(&jme->mii_if, cmd);
spin_unlock_bh(&jme->phy_lock);
return rc;
return 0;
}
static int

View File

@ -699,13 +699,12 @@ static int netdev_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct korina_private *lp = netdev_priv(dev);
int rc;
spin_lock_irq(&lp->lock);
rc = mii_ethtool_get_link_ksettings(&lp->mii_if, cmd);
mii_ethtool_get_link_ksettings(&lp->mii_if, cmd);
spin_unlock_irq(&lp->lock);
return rc;
return 0;
}
static int netdev_set_link_ksettings(struct net_device *dev,

View File

@ -1071,7 +1071,10 @@ static int ks8851_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct ks8851_net *ks = netdev_priv(dev);
return mii_ethtool_get_link_ksettings(&ks->mii, cmd);
mii_ethtool_get_link_ksettings(&ks->mii, cmd);
return 0;
}
static int ks8851_set_link_ksettings(struct net_device *dev,

View File

@ -1315,7 +1315,10 @@ static int ks_get_link_ksettings(struct net_device *netdev,
struct ethtool_link_ksettings *cmd)
{
struct ks_net *ks = netdev_priv(netdev);
return mii_ethtool_get_link_ksettings(&ks->mii, cmd);
mii_ethtool_get_link_ksettings(&ks->mii, cmd);
return 0;
}
static int ks_set_link_ksettings(struct net_device *netdev,

View File

@ -868,7 +868,10 @@ static int w90p910_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct w90p910_ether *ether = netdev_priv(dev);
return mii_ethtool_get_link_ksettings(&ether->mii, cmd);
mii_ethtool_get_link_ksettings(&ether->mii, cmd);
return 0;
}
static int w90p910_set_link_ksettings(struct net_device *dev,

View File

@ -85,9 +85,8 @@ static int pch_gbe_get_link_ksettings(struct net_device *netdev,
{
struct pch_gbe_adapter *adapter = netdev_priv(netdev);
u32 supported, advertising;
int ret;
ret = mii_ethtool_get_link_ksettings(&adapter->mii, ecmd);
mii_ethtool_get_link_ksettings(&adapter->mii, ecmd);
ethtool_convert_link_mode_to_legacy_u32(&supported,
ecmd->link_modes.supported);
@ -104,7 +103,8 @@ static int pch_gbe_get_link_ksettings(struct net_device *netdev,
if (!netif_carrier_ok(adapter->netdev))
ecmd->base.speed = SPEED_UNKNOWN;
return ret;
return 0;
}
/**

View File

@ -1410,14 +1410,13 @@ static int cp_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct cp_private *cp = netdev_priv(dev);
int rc;
unsigned long flags;
spin_lock_irqsave(&cp->lock, flags);
rc = mii_ethtool_get_link_ksettings(&cp->mii_if, cmd);
mii_ethtool_get_link_ksettings(&cp->mii_if, cmd);
spin_unlock_irqrestore(&cp->lock, flags);
return rc;
return 0;
}
static int cp_set_link_ksettings(struct net_device *dev,

View File

@ -2148,7 +2148,9 @@ static int rtl8169_get_link_ksettings_xmii(struct net_device *dev,
{
struct rtl8169_private *tp = netdev_priv(dev);
return mii_ethtool_get_link_ksettings(&tp->mii, cmd);
mii_ethtool_get_link_ksettings(&tp->mii, cmd);
return 0;
}
static int rtl8169_get_link_ksettings(struct net_device *dev,

View File

@ -1562,13 +1562,12 @@ static int ioc3_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct ioc3_private *ip = netdev_priv(dev);
int rc;
spin_lock_irq(&ip->ioc3_lock);
rc = mii_ethtool_get_link_ksettings(&ip->mii, cmd);
mii_ethtool_get_link_ksettings(&ip->mii, cmd);
spin_unlock_irq(&ip->ioc3_lock);
return rc;
return 0;
}
static int ioc3_set_link_ksettings(struct net_device *dev,

View File

@ -1739,7 +1739,9 @@ static int sis190_get_link_ksettings(struct net_device *dev,
{
struct sis190_private *tp = netdev_priv(dev);
return mii_ethtool_get_link_ksettings(&tp->mii_if, cmd);
mii_ethtool_get_link_ksettings(&tp->mii_if, cmd);
return 0;
}
static int sis190_set_link_ksettings(struct net_device *dev,

View File

@ -1391,13 +1391,12 @@ static int netdev_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct epic_private *np = netdev_priv(dev);
int rc;
spin_lock_irq(&np->lock);
rc = mii_ethtool_get_link_ksettings(&np->mii, cmd);
mii_ethtool_get_link_ksettings(&np->mii, cmd);
spin_unlock_irq(&np->lock);
return rc;
return 0;
}
static int netdev_set_link_ksettings(struct net_device *dev,

View File

@ -1450,7 +1450,7 @@ smc911x_ethtool_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct smc911x_local *lp = netdev_priv(dev);
int ret, status;
int status;
unsigned long flags;
u32 supported;
@ -1458,7 +1458,7 @@ smc911x_ethtool_get_link_ksettings(struct net_device *dev,
if (lp->phy_type != 0) {
spin_lock_irqsave(&lp->lock, flags);
ret = mii_ethtool_get_link_ksettings(&lp->mii, cmd);
mii_ethtool_get_link_ksettings(&lp->mii, cmd);
spin_unlock_irqrestore(&lp->lock, flags);
} else {
supported = SUPPORTED_10baseT_Half |
@ -1480,10 +1480,9 @@ smc911x_ethtool_get_link_ksettings(struct net_device *dev,
ethtool_convert_legacy_u32_to_link_mode(
cmd->link_modes.supported, supported);
ret = 0;
}
return ret;
return 0;
}
static int

View File

@ -1843,8 +1843,8 @@ static int smc_link_ok(struct net_device *dev)
}
}
static int smc_netdev_get_ecmd(struct net_device *dev,
struct ethtool_link_ksettings *ecmd)
static void smc_netdev_get_ecmd(struct net_device *dev,
struct ethtool_link_ksettings *ecmd)
{
u16 tmp;
unsigned int ioaddr = dev->base_addr;
@ -1865,8 +1865,6 @@ static int smc_netdev_get_ecmd(struct net_device *dev,
ethtool_convert_legacy_u32_to_link_mode(ecmd->link_modes.supported,
supported);
return 0;
}
static int smc_netdev_set_ecmd(struct net_device *dev,
@ -1918,18 +1916,17 @@ static int smc_get_link_ksettings(struct net_device *dev,
struct smc_private *smc = netdev_priv(dev);
unsigned int ioaddr = dev->base_addr;
u16 saved_bank = inw(ioaddr + BANK_SELECT);
int ret;
unsigned long flags;
spin_lock_irqsave(&smc->lock, flags);
SMC_SELECT_BANK(3);
if (smc->cfg & CFG_MII_SELECT)
ret = mii_ethtool_get_link_ksettings(&smc->mii_if, ecmd);
mii_ethtool_get_link_ksettings(&smc->mii_if, ecmd);
else
ret = smc_netdev_get_ecmd(dev, ecmd);
smc_netdev_get_ecmd(dev, ecmd);
SMC_SELECT_BANK(saved_bank);
spin_unlock_irqrestore(&smc->lock, flags);
return ret;
return 0;
}
static int smc_set_link_ksettings(struct net_device *dev,

View File

@ -1539,11 +1539,10 @@ smc_ethtool_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct smc_local *lp = netdev_priv(dev);
int ret;
if (lp->phy_type != 0) {
spin_lock_irq(&lp->lock);
ret = mii_ethtool_get_link_ksettings(&lp->mii, cmd);
mii_ethtool_get_link_ksettings(&lp->mii, cmd);
spin_unlock_irq(&lp->lock);
} else {
u32 supported = SUPPORTED_10baseT_Half |
@ -1562,11 +1561,9 @@ smc_ethtool_get_link_ksettings(struct net_device *dev,
ethtool_convert_legacy_u32_to_link_mode(
cmd->link_modes.supported, supported);
ret = 0;
}
return ret;
return 0;
}
static int

View File

@ -1504,13 +1504,12 @@ static int tsi108_get_link_ksettings(struct net_device *dev,
{
struct tsi108_prv_data *data = netdev_priv(dev);
unsigned long flags;
int rc;
spin_lock_irqsave(&data->txlock, flags);
rc = mii_ethtool_get_link_ksettings(&data->mii_if, cmd);
mii_ethtool_get_link_ksettings(&data->mii_if, cmd);
spin_unlock_irqrestore(&data->txlock, flags);
return rc;
return 0;
}
static int tsi108_set_link_ksettings(struct net_device *dev,

View File

@ -2307,13 +2307,12 @@ static int netdev_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct rhine_private *rp = netdev_priv(dev);
int rc;
mutex_lock(&rp->task_lock);
rc = mii_ethtool_get_link_ksettings(&rp->mii_if, cmd);
mii_ethtool_get_link_ksettings(&rp->mii_if, cmd);
mutex_unlock(&rp->task_lock);
return rc;
return 0;
}
static int netdev_set_link_ksettings(struct net_device *dev,

View File

@ -141,11 +141,9 @@ int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
*
* The @cmd parameter is expected to have been cleared before calling
* mii_ethtool_get_link_ksettings().
*
* Returns 0 for success, negative on error.
*/
int mii_ethtool_get_link_ksettings(struct mii_if_info *mii,
struct ethtool_link_ksettings *cmd)
void mii_ethtool_get_link_ksettings(struct mii_if_info *mii,
struct ethtool_link_ksettings *cmd)
{
struct net_device *dev = mii->dev;
u16 bmcr, bmsr, ctrl1000 = 0, stat1000 = 0;
@ -227,8 +225,6 @@ int mii_ethtool_get_link_ksettings(struct mii_if_info *mii,
lp_advertising);
/* ignore maxtxpkt, maxrxpkt for now */
return 0;
}
/**

View File

@ -624,7 +624,10 @@ static int ax88179_get_link_ksettings(struct net_device *net,
struct ethtool_link_ksettings *cmd)
{
struct usbnet *dev = netdev_priv(net);
return mii_ethtool_get_link_ksettings(&dev->mii, cmd);
mii_ethtool_get_link_ksettings(&dev->mii, cmd);
return 0;
}
static int ax88179_set_link_ksettings(struct net_device *net,

View File

@ -3835,7 +3835,7 @@ int rtl8152_get_link_ksettings(struct net_device *netdev,
mutex_lock(&tp->control);
ret = mii_ethtool_get_link_ksettings(&tp->mii, cmd);
mii_ethtool_get_link_ksettings(&tp->mii, cmd);
mutex_unlock(&tp->control);

View File

@ -956,7 +956,9 @@ int usbnet_get_link_ksettings(struct net_device *net,
if (!dev->mii.mdio_read)
return -EOPNOTSUPP;
return mii_ethtool_get_link_ksettings(&dev->mii, cmd);
mii_ethtool_get_link_ksettings(&dev->mii, cmd);
return 0;
}
EXPORT_SYMBOL_GPL(usbnet_get_link_ksettings);

View File

@ -31,7 +31,7 @@ struct mii_if_info {
extern int mii_link_ok (struct mii_if_info *mii);
extern int mii_nway_restart (struct mii_if_info *mii);
extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
extern int mii_ethtool_get_link_ksettings(
extern void mii_ethtool_get_link_ksettings(
struct mii_if_info *mii, struct ethtool_link_ksettings *cmd);
extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
extern int mii_ethtool_set_link_ksettings(