Skip to contentSkip to conversation

staging: rtl8723bs: replace msleep with usleep_range in rtw_pwrctrl.c

PATCH In review Muhammad Israr 2 participants 2 messages Sep 5 – Sep 7 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: replace msleep with usleep_range in rtw_pwrctrl.c

The checkpatch tool flags msleep() calls for durations less than 20ms because they can sleep for much longer due to timer granularity. Use usleep_range() for the 1ms delay to provide a flexible sleep window and avoid inaccurate task scheduling.

---
 drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +2 -2
index 448611ad8..5ef44a3ae 100644
@@ -410,7 +410,7 @@ int LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
 		if (jiffies_to_msecs(jiffies - start_time) > delay_ms)
 			return -ETIMEDOUT;
 
-		msleep(1);
+		usleep_range(1000, 2000);
 	}
 }
 
@@ -561,7 +561,7 @@ void LPS_Leave_check(struct adapter *padapter)
 		if (jiffies_to_msecs(jiffies - start_time) > 100)
 			break;
 
-		msleep(1);
+		usleep_range(1000, 2000);
 	}
 }
 
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 9 lines · Muhammad Israr

The checkpatch tool flags msleep() calls for durations less than 20ms because they can sleep for much longer due to timer granularity. Use usleep_range() for the 1ms delay to provide a flexible sleep window and avoid inaccurate task scheduling.

---
 drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Please see the mailing list archives for why this patch keeps getting rejected.

thanks,

greg k-h