Skip to contentSkip to conversation

staging: rtl8723bs: use usleep_range() instead of msleep()

PATCH In review Luka Miletic 2 participants 2 messages Aug 22 – Sep 1 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: use usleep_range() instead of msleep()

Use usleep_range() instead of msleep() to fix checkpatch warnings. Verified both loops exit on their own condition, independent of sleep duration, so this only changes timing precision, not behavior.

---
 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
index c15056ee2..8b793680f 100644
@@ -986,7 +986,7 @@ void rtw_dev_unload(struct adapter *padapter)
 			if (cnt > 5)
 				break;
 			cnt++;
-			msleep(10);
+			usleep_range(10000, 20000);
 		}
 
 		/* check the status of IPS */
@@ -1086,7 +1086,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->driver_stopped) || (padapter->bSurpriseRemoved))
 		return;
Signature · 1 line
2.34.1
#1 lore raw
Quoted 14 lines · Luka Miletic

Use usleep_range() instead of msleep() to fix checkpatch warnings. Verified both loops exit on their own condition, independent of sleep duration, so this only changes timing precision, not behavior.

---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +0 -0
index c15056ee2..8b793680f 100644

drivers/staging/rtl8723bs/os_dep/os_intfs.c void rtw_dev_unload(struct adapter *padapter) · line 989

Quoted 5 lines
drivers/staging/rtl8723bs/os_dep/os_intfs.c +1 -1
@@ -986,7 +986,7 @@ void rtw_dev_unload(struct adapter *padapter)
 			if (cnt > 5)
 				break;
 			cnt++;
-			msleep(10);
+			usleep_range(10000, 20000);

Please see the mailing list archives for why we can't take this change.

sorry,

greg k-h