[PATCH v2 19/23] staging: qlge: Fix WARNING: msleep < 20ms can sleep for up to 20ms

From: Scott Schafer
Date: Wed Dec 11 2019 - 13:15:39 EST


Fix WARNING: msleep < 20ms can sleep for up to 20ms by changing msleep
to usleep_range() in qlge_dbg.c, qlge_ethtool.c, and qlge_main.c

Signed-off-by: Scott Schafer <schaferjscott@xxxxxxxxx>
---
drivers/staging/qlge/qlge_dbg.c | 2 +-
drivers/staging/qlge/qlge_ethtool.c | 2 +-
drivers/staging/qlge/qlge_main.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
index 0f1e1b62662d..ba801de02109 100644
--- a/drivers/staging/qlge/qlge_dbg.c
+++ b/drivers/staging/qlge/qlge_dbg.c
@@ -1340,7 +1340,7 @@ void ql_mpi_core_to_log(struct work_struct *work)
tmp[i + 5],
tmp[i + 6],
tmp[i + 7]);
- msleep(5);
+ usleep_range(5000, 6000);
}
}

diff --git a/drivers/staging/qlge/qlge_ethtool.c b/drivers/staging/qlge/qlge_ethtool.c
index b9e1e154d646..abed932c3694 100644
--- a/drivers/staging/qlge/qlge_ethtool.c
+++ b/drivers/staging/qlge/qlge_ethtool.c
@@ -555,7 +555,7 @@ static int ql_run_loopback_test(struct ql_adapter *qdev)
atomic_inc(&qdev->lb_count);
}
/* Give queue time to settle before testing results. */
- msleep(2);
+ usleep_range(2000, 3000);
ql_clean_lb_rx_ring(&qdev->rx_ring[0], 128);
return atomic_read(&qdev->lb_count) ? -EIO : 0;
}
diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
index c6e26a757268..e18aa335c899 100644
--- a/drivers/staging/qlge/qlge_main.c
+++ b/drivers/staging/qlge/qlge_main.c
@@ -3924,7 +3924,7 @@ static int qlge_close(struct net_device *ndev)
* (Rarely happens, but possible.)
*/
while (!test_bit(QL_ADAPTER_UP, &qdev->flags))
- msleep(1);
+ usleep_range(1000, 2000);

/* Make sure refill_work doesn't re-enable napi */
for (i = 0; i < qdev->rss_ring_count; i++)
--
2.20.1