mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: replace msleep with usleep_range in rtw_pwrctrl.c
@ 2026-09-05  5:26 Muhammad Israr
  0 siblings, 0 replies; 2+ messages in thread
From: Muhammad Israr @ 2026-09-05  5:26 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, 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.

Signed-off-by: Muhammad Israr <7israr.work@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
index 448611ad8..5ef44a3ae 100644
--- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
@@ -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);
 	}
 }
 
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] staging: rtl8723bs: replace msleep with usleep_range in rtw_pwrctrl.c
@ 2026-06-18 22:54 Andrezinrc
  0 siblings, 0 replies; 2+ messages in thread
From: Andrezinrc @ 2026-06-18 22:54 UTC (permalink / raw)
  To: linux-staging; +Cc: linux-kernel, Andrezinrc

The checkpatch.pl tool complains about using msleep() for delays
under 20ms, as it can sleep for longer than intended. Replace the
msleep(1) calls with usleep_range(1000, 2000) to provide more
accurate timing and clean up the style warnings.

Signed-off-by: Andrezinrc <andrem.33333@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
index f074ea6e0..cdbdcb7bd 100644
--- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
@@ -414,7 +414,7 @@ s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
 			err = -1;
 			break;
 		}
-		msleep(1);
+		usleep_range(1000, 2000);
 	}
 
 	return err;
@@ -567,7 +567,7 @@ void LPS_Leave_check(struct adapter *padapter)
 		if (jiffies_to_msecs(jiffies - start_time) > 100)
 			break;
 
-		msleep(1);
+		usleep_range(1000, 2000);
 	}
 }
 
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-05  5:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-05  5:26 [PATCH] staging: rtl8723bs: replace msleep with usleep_range in rtw_pwrctrl.c Muhammad Israr
  -- strict thread matches above, loose matches on Subject: below --
2026-06-18 22:54 Andrezinrc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®