[PATCH] staging: rtl8723bs: replace msleep with usleep_range
From: Marcos Andrade
Date: Sat Mar 14 2026 - 01:11:33 EST
The msleep() function is not recommended for delays under 20ms
as it may sleep for longer than desired. Replace msleep(10) with
usleep_range(10000, 11000) to ensure a more precise delay and
better kernel scheduling behavior.
This resolves a checkpatch.pl warning.
Signed-off-by: Marcos Andrade <marcosandrade95963@xxxxxxxxx>
---
drivers/staging/rtl8723bs/core/rtw_cmd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index abb84f8ae..261d2e306 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -4,6 +4,7 @@
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
*
******************************************************************************/
+#include "linux/delay.h"
#include <drv_types.h>
#include <hal_btcoex.h>
#include <linux/jiffies.h>
@@ -214,7 +215,7 @@ void _rtw_free_evt_priv(struct evt_priv *pevtpriv)
{
_cancel_workitem_sync(&pevtpriv->c2h_wk);
while (pevtpriv->c2h_wk_alive)
- msleep(10);
+ usleep_range(10000, 11000);
while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);
--
2.53.0