All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: ethernet:fec: Consistently use SPEED_ prefix
@ 2018-10-20 20:48 Andrew Lunn
  2018-10-21  8:25 ` Sergei Shtylyov
  2018-10-22  2:41 ` Andy Duan
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Lunn @ 2018-10-20 20:48 UTC (permalink / raw)
  To: David Miller; +Cc: clabbe, netdev, Florian Fainelli, hkallweit1, Andrew Lunn

All other calls to phy_set_max_speed() use the SPEED_ prefix. Make the
FEC driver follow this common pattern. This makes no different to
generated code since SPEED_1000 is 1000, and SPEED_100 is 100.

Reported-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/ethernet/freescale/fec_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 6db69ba30dcd..b067eaf8b792 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1948,7 +1948,7 @@ static int fec_enet_mii_probe(struct net_device *ndev)
 
 	/* mask with MAC supported features */
 	if (fep->quirks & FEC_QUIRK_HAS_GBIT) {
-		phy_set_max_speed(phy_dev, 1000);
+		phy_set_max_speed(phy_dev, SPEED_1000);
 		phy_remove_link_mode(phy_dev,
 				     ETHTOOL_LINK_MODE_1000baseT_Half_BIT);
 #if !defined(CONFIG_M5272)
@@ -1956,7 +1956,7 @@ static int fec_enet_mii_probe(struct net_device *ndev)
 #endif
 	}
 	else
-		phy_set_max_speed(phy_dev, 100);
+		phy_set_max_speed(phy_dev, SPEED_100);
 
 	fep->link = 0;
 	fep->full_duplex = 0;
-- 
2.19.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: ethernet:fec: Consistently use SPEED_ prefix
  2018-10-20 20:48 [PATCH] net: ethernet:fec: Consistently use SPEED_ prefix Andrew Lunn
@ 2018-10-21  8:25 ` Sergei Shtylyov
  2018-10-22  2:41 ` Andy Duan
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2018-10-21  8:25 UTC (permalink / raw)
  To: Andrew Lunn, David Miller; +Cc: clabbe, netdev, Florian Fainelli, hkallweit1

On 20.10.2018 23:48, Andrew Lunn wrote:

> All other calls to phy_set_max_speed() use the SPEED_ prefix. Make the
> FEC driver follow this common pattern. This makes no different to

    Difference.

> generated code since SPEED_1000 is 1000, and SPEED_100 is 100.
>
> Reported-by: Corentin Labbe <clabbe@baylibre.com>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] net: ethernet:fec: Consistently use SPEED_ prefix
  2018-10-20 20:48 [PATCH] net: ethernet:fec: Consistently use SPEED_ prefix Andrew Lunn
  2018-10-21  8:25 ` Sergei Shtylyov
@ 2018-10-22  2:41 ` Andy Duan
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Duan @ 2018-10-22  2:41 UTC (permalink / raw)
  To: Andrew Lunn, David Miller; +Cc: clabbe, netdev, Florian Fainelli, hkallweit1

From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org>
> All other calls to phy_set_max_speed() use the SPEED_ prefix. Make the
> FEC driver follow this common pattern. This makes no different to
> generated code since SPEED_1000 is 1000, and SPEED_100 is 100.
> 

Please also add more information that was introduced by commit: 58056c1e1b0e ("net: ethernet: Use phy_set_max_speed() to limit advertised speed ")

Andy
> Reported-by: Corentin Labbe <clabbe@baylibre.com>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  drivers/net/ethernet/freescale/fec_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fec_main.c
> b/drivers/net/ethernet/freescale/fec_main.c
> index 6db69ba30dcd..b067eaf8b792 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -1948,7 +1948,7 @@ static int fec_enet_mii_probe(struct
> net_device *ndev)
> 
>  	/* mask with MAC supported features */
>  	if (fep->quirks & FEC_QUIRK_HAS_GBIT) {
> -		phy_set_max_speed(phy_dev, 1000);
> +		phy_set_max_speed(phy_dev, SPEED_1000);
>  		phy_remove_link_mode(phy_dev,
>  				     ETHTOOL_LINK_MODE_1000baseT_Half_BIT);
>  #if !defined(CONFIG_M5272)
> @@ -1956,7 +1956,7 @@ static int fec_enet_mii_probe(struct
> net_device *ndev)  #endif
>  	}
>  	else
> -		phy_set_max_speed(phy_dev, 100);
> +		phy_set_max_speed(phy_dev, SPEED_100);
> 
>  	fep->link = 0;
>  	fep->full_duplex = 0;
> --
> 2.19.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-22 10:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-20 20:48 [PATCH] net: ethernet:fec: Consistently use SPEED_ prefix Andrew Lunn
2018-10-21  8:25 ` Sergei Shtylyov
2018-10-22  2:41 ` Andy Duan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.