diff options
author | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2015-02-20 23:55:56 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2015-02-23 20:11:54 -0500 |
commit | 5beef769ec839f7f7e9679648de471be99677537 (patch) | |
tree | 97986fe042847ebdfa3997c160b4d4c271ce5a3b /drivers/net/ethernet/intel/igbvf/ethtool.c | |
parent | 0340501b1cf7dc67bc53dcbe26d3c7d678157606 (diff) |
igbvf: cleanup msleep() and min/max() usage
Fixed a few cases of when we used msleep() when we should have been
using usleep_range(). Also updated the usage of min/max() to use
min_t/max_t().
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igbvf/ethtool.c')
-rw-r--r-- | drivers/net/ethernet/intel/igbvf/ethtool.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/igbvf/ethtool.c b/drivers/net/ethernet/intel/igbvf/ethtool.c index 91a1190990ae..c6996feb1cb4 100644 --- a/drivers/net/ethernet/intel/igbvf/ethtool.c +++ b/drivers/net/ethernet/intel/igbvf/ethtool.c | |||
@@ -224,12 +224,12 @@ static int igbvf_set_ringparam(struct net_device *netdev, | |||
224 | if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending)) | 224 | if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending)) |
225 | return -EINVAL; | 225 | return -EINVAL; |
226 | 226 | ||
227 | new_rx_count = max(ring->rx_pending, (u32)IGBVF_MIN_RXD); | 227 | new_rx_count = max_t(u32, ring->rx_pending, IGBVF_MIN_RXD); |
228 | new_rx_count = min(new_rx_count, (u32)IGBVF_MAX_RXD); | 228 | new_rx_count = min_t(u32, new_rx_count, IGBVF_MAX_RXD); |
229 | new_rx_count = ALIGN(new_rx_count, REQ_RX_DESCRIPTOR_MULTIPLE); | 229 | new_rx_count = ALIGN(new_rx_count, REQ_RX_DESCRIPTOR_MULTIPLE); |
230 | 230 | ||
231 | new_tx_count = max(ring->tx_pending, (u32)IGBVF_MIN_TXD); | 231 | new_tx_count = max_t(u32, ring->tx_pending, IGBVF_MIN_TXD); |
232 | new_tx_count = min(new_tx_count, (u32)IGBVF_MAX_TXD); | 232 | new_tx_count = min_t(u32, new_tx_count, IGBVF_MAX_TXD); |
233 | new_tx_count = ALIGN(new_tx_count, REQ_TX_DESCRIPTOR_MULTIPLE); | 233 | new_tx_count = ALIGN(new_tx_count, REQ_TX_DESCRIPTOR_MULTIPLE); |
234 | 234 | ||
235 | if ((new_tx_count == adapter->tx_ring->count) && | 235 | if ((new_tx_count == adapter->tx_ring->count) && |
@@ -239,7 +239,7 @@ static int igbvf_set_ringparam(struct net_device *netdev, | |||
239 | } | 239 | } |
240 | 240 | ||
241 | while (test_and_set_bit(__IGBVF_RESETTING, &adapter->state)) | 241 | while (test_and_set_bit(__IGBVF_RESETTING, &adapter->state)) |
242 | msleep(1); | 242 | usleep_range(1000, 2000); |
243 | 243 | ||
244 | if (!netif_running(adapter->netdev)) { | 244 | if (!netif_running(adapter->netdev)) { |
245 | adapter->tx_ring->count = new_tx_count; | 245 | adapter->tx_ring->count = new_tx_count; |