staging: rtl8723bs: os_intfs: replace msleep with usleep_range
PATCH 1/1 staging: rtl8723bs: os_intfs: replace msleep with usleep_range
checkpatch.pl warns that msleep() of durations <20ms may sleep for up to 20ms. As per Documentation/timers/delay_sleep_functions.rst, usleep_range() should be used whenever the accuracy of msleep() is not sufficient in order to avoid jiffy rounding.
Replaced msleep(10) with usleep_range(10000, 11000) and replaced a 1ms polling loop (msleep(1)) with usleep_range(1000, 2000). This should provide improved scheduling tolerances without changing the minimum delay expectation for the hardware.
--- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +2 -2
@@ -992,7 +992,7 @@ void rtw_dev_unload(struct adapter *padapter)if (cnt >5 )break ; cnt++; -msleep (10 ); +usleep_range (10000 ,11000 ); }/* check the status of IPS */
@@ -1092,7 +1092,7 @@ void rtw_suspend_common(struct adapter *padapter) pwrpriv->bInSuspend = true;while (pwrpriv->bips_processing) -msleep (1 ); +usleep_range (1000 ,2000 );if ((!padapter->bup) || (padapter->bDriverStopped) || (padapter->bSurpriseRemoved))return ;
Signature · 1 line
2.55.0
Greg Kroah-Hartman
maintainerQuoted 9 lines · Connor Sample
checkpatch.pl warns that
msleep()of durations <20ms may sleep for up to 20ms. As perDocumentation/timers/delay_sleep_functions.rst,usleep_range()should be used whenever the accuracy ofmsleep()is not sufficient in order to avoid jiffy rounding.Replaced
msleep(10)withusleep_range(10000, 11000)and replaced a 1ms polling loop (msleep(1)) withusleep_range(1000, 2000). This should provide improved scheduling tolerances without changing the minimum delay expectation for the hardware.
Please see the many places in the mailing list archives where we have rejected this same patch :)