Re: [PATCH] staging: rtl8723bs: replace msleep with usleep_range
From: Dan Carpenter
Date: Thu Sep 17 2026 - 03:50:24 EST
On Thu, Sep 17, 2026 at 10:19:31AM +0300, Omer PALA wrote:
> Replace msleep(1) with usleep_range(1000, 1500) because msleep with small
> values (<20ms) can sleep for up to 20ms due to timer tick resolution.
> Using usleep_range provides a more precise and consistent delay for
> hardware power control operations.
>
> Signed-off-by: Omer PALA <palaomer100@xxxxxxxxx>
> ---
> drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
> index 448611ad8..1d3262413 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
> @@ -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, 1500);
These kinds of changes need to be tested.
I don't love this checkpatch warning because it we reject almost all
these patches. If it were new code, presumably the person sending the
patch would be able to test it... But I guess it serves as a kind of
lesson to not listen to checkpatch and also to search lore before
sending stuff.
https://lore.kernel.org/all/?q=LPS_Leave_check%20msleep
regards,
dan carpenter