Netdev List
 help / color / mirror / Atom feed
* [net-next-2.6 PATCH 1/7] igb: change type for ring sizes to u16 in igb_set_ring_param
@ 2009-11-13  4:36 Jeff Kirsher
  2009-11-13  4:37 ` [net-next-2.6 PATCH 2/7] igb: move timesync init into a seperate function Jeff Kirsher
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Jeff Kirsher @ 2009-11-13  4:36 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, Alexander Duyck, Jeff Kirsher

From: Alexander Duyck <alexander.h.duyck@intel.com>

Change the type for the ring size values to u16 and use min/max_t instead of
min/max.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/igb_ethtool.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index 90b89a8..f2b2825 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -735,17 +735,17 @@ static int igb_set_ringparam(struct net_device *netdev,
 	struct igb_adapter *adapter = netdev_priv(netdev);
 	struct igb_ring *temp_ring;
 	int i, err = 0;
-	u32 new_rx_count, new_tx_count;
+	u16 new_rx_count, new_tx_count;
 
 	if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
 		return -EINVAL;
 
-	new_rx_count = min(ring->rx_pending, (u32)IGB_MAX_RXD);
-	new_rx_count = max(new_rx_count, (u32)IGB_MIN_RXD);
+	new_rx_count = min_t(u32, ring->rx_pending, IGB_MAX_RXD);
+	new_rx_count = max_t(u16, new_rx_count, IGB_MIN_RXD);
 	new_rx_count = ALIGN(new_rx_count, REQ_RX_DESCRIPTOR_MULTIPLE);
 
-	new_tx_count = min(ring->tx_pending, (u32)IGB_MAX_TXD);
-	new_tx_count = max(new_tx_count, (u32)IGB_MIN_TXD);
+	new_tx_count = min_t(u32, ring->tx_pending, IGB_MAX_TXD);
+	new_tx_count = max_t(u16, new_tx_count, IGB_MIN_TXD);
 	new_tx_count = ALIGN(new_tx_count, REQ_TX_DESCRIPTOR_MULTIPLE);
 
 	if ((new_tx_count == adapter->tx_ring_count) &&


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

end of thread, other threads:[~2009-11-14  4:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-13  4:36 [net-next-2.6 PATCH 1/7] igb: change type for ring sizes to u16 in igb_set_ring_param Jeff Kirsher
2009-11-13  4:37 ` [net-next-2.6 PATCH 2/7] igb: move timesync init into a seperate function Jeff Kirsher
2009-11-13  4:37 ` [net-next-2.6 PATCH 3/7] igb: when number of CPUs > 4 combine tx/rx queues to allow more queues Jeff Kirsher
2009-11-13  4:37 ` [net-next-2.6 PATCH 4/7] igb: Rework how netdev->stats is handled Jeff Kirsher
2009-11-13  4:37 ` [net-next-2.6 PATCH 5/7] igb: removed unused tx/rx total bytes/packets from adapter struct Jeff Kirsher
2009-11-13  4:38 ` [net-next-2.6 PATCH 6/7] igb: check for packets on all tx rings when link is down Jeff Kirsher
2009-11-13  4:38 ` [net-next-2.6 PATCH 7/7] igb: only recycle page if it is on our numa node Jeff Kirsher
2009-11-14  4:48 ` [net-next-2.6 PATCH 1/7] igb: change type for ring sizes to u16 in igb_set_ring_param David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox