All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] cgxb4: Stop using ethtool SPEED_* constants
@ 2014-02-23  0:03 Ben Hutchings
  2014-02-25  0:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Hutchings @ 2014-02-23  0:03 UTC (permalink / raw)
  To: David Miller; +Cc: Dimitris Michailidis, Kumar Sanghvi, netdev

[-- Attachment #1: Type: text/plain, Size: 3076 bytes --]

ethtool speed values are just numbers of megabits and there is no need
to add SPEED_40000.  To be consistent, use integer constants directly
for all speeds.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 20 ++++++++++----------
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c      |  8 ++++----
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 4660f55..da4edc1 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -427,16 +427,16 @@ static void link_report(struct net_device *dev)
 		const struct port_info *p = netdev_priv(dev);
 
 		switch (p->link_cfg.speed) {
-		case SPEED_10000:
+		case 10000:
 			s = "10Gbps";
 			break;
-		case SPEED_1000:
+		case 1000:
 			s = "1000Mbps";
 			break;
-		case SPEED_100:
+		case 100:
 			s = "100Mbps";
 			break;
-		case 40000: /* Need a SPEED_40000 in ethtool.h */
+		case 40000:
 			s = "40Gbps";
 			break;
 		}
@@ -2274,13 +2274,13 @@ static int get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 
 static unsigned int speed_to_caps(int speed)
 {
-	if (speed == SPEED_100)
+	if (speed == 100)
 		return FW_PORT_CAP_SPEED_100M;
-	if (speed == SPEED_1000)
+	if (speed == 1000)
 		return FW_PORT_CAP_SPEED_1G;
-	if (speed == SPEED_10000)
+	if (speed == 10000)
 		return FW_PORT_CAP_SPEED_10G;
-	if (speed == 40000) /* Need SPEED_40000 in ethtool.h */
+	if (speed == 40000)
 		return FW_PORT_CAP_SPEED_40G;
 	return 0;
 }
@@ -2310,8 +2310,8 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 		cap = speed_to_caps(speed);
 
 		if (!(lc->supported & cap) ||
-		    (speed == SPEED_1000) ||
-		    (speed == SPEED_10000) ||
+		    (speed == 1000) ||
+		    (speed == 10000) ||
 		    (speed == 40000))
 			return -EINVAL;
 		lc->requested_speed = cap;
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 7ae756d..d3c2a51 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -3567,13 +3567,13 @@ int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl)
 		if (stat & FW_PORT_CMD_TXPAUSE)
 			fc |= PAUSE_TX;
 		if (stat & FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_100M))
-			speed = SPEED_100;
+			speed = 100;
 		else if (stat & FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_1G))
-			speed = SPEED_1000;
+			speed = 1000;
 		else if (stat & FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_10G))
-			speed = SPEED_10000;
+			speed = 10000;
 		else if (stat & FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_40G))
-			speed = 40000; /* Need SPEED_40000 in ethtool.h */
+			speed = 40000;
 
 		if (link_ok != lc->link_ok || speed != lc->speed ||
 		    fc != lc->fc) {                    /* something changed */

-- 
Ben Hutchings
I haven't lost my mind; it's backed up on tape somewhere.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* Re: [PATCH net-next] cgxb4: Stop using ethtool SPEED_* constants
  2014-02-23  0:03 [PATCH net-next] cgxb4: Stop using ethtool SPEED_* constants Ben Hutchings
@ 2014-02-25  0:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-02-25  0:04 UTC (permalink / raw)
  To: ben; +Cc: dm, kumaras, netdev

From: Ben Hutchings <ben@decadent.org.uk>
Date: Sun, 23 Feb 2014 00:03:24 +0000

> ethtool speed values are just numbers of megabits and there is no need
> to add SPEED_40000.  To be consistent, use integer constants directly
> for all speeds.
> 
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

Applied, thanks Ben.

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

end of thread, other threads:[~2014-02-25  0:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-23  0:03 [PATCH net-next] cgxb4: Stop using ethtool SPEED_* constants Ben Hutchings
2014-02-25  0:04 ` David Miller

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.