Re: [PATCH] staging: rtl8723bs: change msleep to usleep_range
From: Andy Shevchenko
Date: Wed Feb 25 2026 - 11:04:21 EST
On Wed, Feb 25, 2026 at 01:57:23PM +0000, Rodrigo Filipe Faria wrote:
> checkpatch.pl gave "WARNING: msleep < 20ms can sleep for up to 20ms".
>
> Kernel documentation says that usleep_range() must be used for
> delays of 10us to 20ms.
> msleep() is inaccurate with the values used.
No, the modern API is fsleep().
...
> @@ -214,7 +214,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);
I saw something similar in the past.
https://lore.kernel.org/linux-staging/20260214173139.49094-1-ofekalm100@xxxxxxxxx/
--
With Best Regards,
Andy Shevchenko