vmxnet3: Replace msleep(1) with usleep_range()
authorYueHaibing <yuehaibing@huawei.com>
Thu, 17 May 2018 03:46:41 +0000 (11:46 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 May 2018 19:55:38 +0000 (15:55 -0400)
As documented in Documentation/timers/timers-howto.txt,
replace msleep(1) with usleep_range().

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vmxnet3/vmxnet3_drv.c
drivers/net/vmxnet3/vmxnet3_ethtool.c

index 9ebe2a689966d056a1b9a94e5ea557f0d0f9a55e..2234a334e96e574e2a5a2158f73529794af14a98 100644 (file)
@@ -2945,7 +2945,7 @@ vmxnet3_close(struct net_device *netdev)
         * completion.
         */
        while (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state))
-               msleep(1);
+               usleep_range(1000, 2000);
 
        vmxnet3_quiesce_dev(adapter);
 
@@ -2995,7 +2995,7 @@ vmxnet3_change_mtu(struct net_device *netdev, int new_mtu)
         * completion.
         */
        while (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state))
-               msleep(1);
+               usleep_range(1000, 2000);
 
        if (netif_running(netdev)) {
                vmxnet3_quiesce_dev(adapter);
@@ -3567,7 +3567,7 @@ static void vmxnet3_shutdown_device(struct pci_dev *pdev)
         * completion.
         */
        while (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state))
-               msleep(1);
+               usleep_range(1000, 2000);
 
        if (test_and_set_bit(VMXNET3_STATE_BIT_QUIESCED,
                             &adapter->state)) {
index 2ff27314e04739034cef408b59aed6a77cd98911..559db051a500f4f339a20ac8d9094379c31eb805 100644 (file)
@@ -600,7 +600,7 @@ vmxnet3_set_ringparam(struct net_device *netdev,
         * completion.
         */
        while (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state))
-               msleep(1);
+               usleep_range(1000, 2000);
 
        if (netif_running(netdev)) {
                vmxnet3_quiesce_dev(adapter);