summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-11-12 18:36:41 +0000
committerDavid S. Miller <davem@davemloft.net>2009-11-13 20:46:48 -0800
commit0e15439ae5fefe438056a26a00aa3c6a9de454e9 (patch)
treee16c8a9fda2ffb48a9f6c49e9f1f36876617e385
parentddb1417529559810ec2024fd8ca21e4d497a3275 (diff)
downloadlinux-3.10-0e15439ae5fefe438056a26a00aa3c6a9de454e9.tar.gz
linux-3.10-0e15439ae5fefe438056a26a00aa3c6a9de454e9.tar.bz2
linux-3.10-0e15439ae5fefe438056a26a00aa3c6a9de454e9.zip
igb: change type for ring sizes to u16 in igb_set_ring_param
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> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/igb/igb_ethtool.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index 90b89a81f66..f2b28254f2a 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) &&