diff mbox

[1/7] net: mv643xx_eth: Simplify mv643xx_eth_adjust_link()

Message ID 1399141622-30654-2-git-send-email-ezequiel.garcia@free-electrons.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Ezequiel Garcia May 3, 2014, 6:26 p.m. UTC
Currently, mv643xx_eth_adjust_link() is only used to call mv643xx_adjust_pscr().
This commit renames the latter to the former, and therefore removes the extra
and useless function.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
 drivers/net/ethernet/marvell/mv643xx_eth.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

Comments

Sebastian Hesselbarth May 4, 2014, 9:23 p.m. UTC | #1
On 05/03/2014 08:26 PM, Ezequiel Garcia wrote:
> Currently, mv643xx_eth_adjust_link() is only used to call mv643xx_adjust_pscr().
> This commit renames the latter to the former, and therefore removes the extra
> and useless function.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>

Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>

Thanks!

> ---
>  drivers/net/ethernet/marvell/mv643xx_eth.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> index b7b8d74..1e63c63 100644
> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
> @@ -1010,8 +1010,10 @@ static void txq_set_fixed_prio_mode(struct tx_queue *txq)
>  
>  
>  /* mii management interface *************************************************/
> -static void mv643xx_adjust_pscr(struct mv643xx_eth_private *mp)
> +static void mv643xx_eth_adjust_link(struct net_device *dev)
>  {
> +	struct mv643xx_eth_private *mp = netdev_priv(dev);
> +
>  	u32 pscr = rdlp(mp, PORT_SERIAL_CONTROL);
>  	u32 autoneg_disable = FORCE_LINK_PASS |
>  	             DISABLE_AUTO_NEG_SPEED_GMII |
> @@ -1387,7 +1389,7 @@ mv643xx_eth_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
>  
>  	ret = phy_ethtool_sset(mp->phy, cmd);
>  	if (!ret)
> -		mv643xx_adjust_pscr(mp);
> +		mv643xx_eth_adjust_link(dev);
>  	return ret;
>  }
>  
> @@ -2303,7 +2305,7 @@ static int mv643xx_eth_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
>  
>  	ret = phy_mii_ioctl(mp->phy, ifr, cmd);
>  	if (!ret)
> -		mv643xx_adjust_pscr(mp);
> +		mv643xx_eth_adjust_link(dev);
>  	return ret;
>  }
>  
> @@ -2701,13 +2703,6 @@ static void set_params(struct mv643xx_eth_private *mp,
>  	mp->txq_count = pd->tx_queue_count ? : 1;
>  }
>  
> -static void mv643xx_eth_adjust_link(struct net_device *dev)
> -{
> -	struct mv643xx_eth_private *mp = netdev_priv(dev);
> -
> -	mv643xx_adjust_pscr(mp);
> -}
> -
>  static struct phy_device *phy_scan(struct mv643xx_eth_private *mp,
>  				   int phy_addr)
>  {
> 

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller May 5, 2014, 7:40 p.m. UTC | #2
From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Date: Sat,  3 May 2014 15:26:56 -0300

> Currently, mv643xx_eth_adjust_link() is only used to call mv643xx_adjust_pscr().
> This commit renames the latter to the former, and therefore removes the extra
> and useless function.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> ---
>  drivers/net/ethernet/marvell/mv643xx_eth.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> index b7b8d74..1e63c63 100644
> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
> @@ -1010,8 +1010,10 @@ static void txq_set_fixed_prio_mode(struct tx_queue *txq)
>  
>  
>  /* mii management interface *************************************************/
> -static void mv643xx_adjust_pscr(struct mv643xx_eth_private *mp)
> +static void mv643xx_eth_adjust_link(struct net_device *dev)
>  {
> +	struct mv643xx_eth_private *mp = netdev_priv(dev);
> +
>  	u32 pscr = rdlp(mp, PORT_SERIAL_CONTROL);
>  	u32 autoneg_disable = FORCE_LINK_PASS |
>  	             DISABLE_AUTO_NEG_SPEED_GMII |

Please do not add empty lines in the middle of the function local variable declarations.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ezequiel Garcia May 6, 2014, 4:17 p.m. UTC | #3
On 05 May 03:40 PM, David Miller wrote:
> From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> Date: Sat,  3 May 2014 15:26:56 -0300
> 
> > Currently, mv643xx_eth_adjust_link() is only used to call mv643xx_adjust_pscr().
> > This commit renames the latter to the former, and therefore removes the extra
> > and useless function.
> > 
> > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > ---
> >  drivers/net/ethernet/marvell/mv643xx_eth.c | 15 +++++----------
> >  1 file changed, 5 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> > index b7b8d74..1e63c63 100644
> > --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> > +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
> > @@ -1010,8 +1010,10 @@ static void txq_set_fixed_prio_mode(struct tx_queue *txq)
> >  
> >  
> >  /* mii management interface *************************************************/
> > -static void mv643xx_adjust_pscr(struct mv643xx_eth_private *mp)
> > +static void mv643xx_eth_adjust_link(struct net_device *dev)
> >  {
> > +	struct mv643xx_eth_private *mp = netdev_priv(dev);
> > +
> >  	u32 pscr = rdlp(mp, PORT_SERIAL_CONTROL);
> >  	u32 autoneg_disable = FORCE_LINK_PASS |
> >  	             DISABLE_AUTO_NEG_SPEED_GMII |
> 
> Please do not add empty lines in the middle of the function local variable declarations.

Argh, I missed this.

Thanks for the catch,
diff mbox

Patch

diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index b7b8d74..1e63c63 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -1010,8 +1010,10 @@  static void txq_set_fixed_prio_mode(struct tx_queue *txq)
 
 
 /* mii management interface *************************************************/
-static void mv643xx_adjust_pscr(struct mv643xx_eth_private *mp)
+static void mv643xx_eth_adjust_link(struct net_device *dev)
 {
+	struct mv643xx_eth_private *mp = netdev_priv(dev);
+
 	u32 pscr = rdlp(mp, PORT_SERIAL_CONTROL);
 	u32 autoneg_disable = FORCE_LINK_PASS |
 	             DISABLE_AUTO_NEG_SPEED_GMII |
@@ -1387,7 +1389,7 @@  mv643xx_eth_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 
 	ret = phy_ethtool_sset(mp->phy, cmd);
 	if (!ret)
-		mv643xx_adjust_pscr(mp);
+		mv643xx_eth_adjust_link(dev);
 	return ret;
 }
 
@@ -2303,7 +2305,7 @@  static int mv643xx_eth_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 
 	ret = phy_mii_ioctl(mp->phy, ifr, cmd);
 	if (!ret)
-		mv643xx_adjust_pscr(mp);
+		mv643xx_eth_adjust_link(dev);
 	return ret;
 }
 
@@ -2701,13 +2703,6 @@  static void set_params(struct mv643xx_eth_private *mp,
 	mp->txq_count = pd->tx_queue_count ? : 1;
 }
 
-static void mv643xx_eth_adjust_link(struct net_device *dev)
-{
-	struct mv643xx_eth_private *mp = netdev_priv(dev);
-
-	mv643xx_adjust_pscr(mp);
-}
-
 static struct phy_device *phy_scan(struct mv643xx_eth_private *mp,
 				   int phy_addr)
 {