[PATCH v3 2/2] staging: rtl8723bs: Replace msleep() with fsleep()

Marcos Andrade posted 2 patches 3 weeks, 2 days ago
There is a newer version of this series
[PATCH v3 2/2] staging: rtl8723bs: Replace msleep() with fsleep()
Posted by Marcos Andrade 3 weeks, 2 days ago
Replace msleep(10) with fsleep(10 * USEC_PER_MSEC) in _rtw_init_xmit_priv().
fsleep() is the new standard API for delays, as it automatically chooses
the best sleep method based on the duration.

Suggested-by: Ethan Tidmore <ethantidmore06@gmail.com>
Signed-off-by: Marcos Andrade <marcosandrade95963@gmail.com>
---
Changes in v3:
 - New patch added to the series based on reviewer feedback.

 drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index 4062fe0c1..dab16851f 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -5,6 +5,7 @@
  *
  ******************************************************************************/
 #include <drv_types.h>
+#include <linux/delay.h>
 #include <linux/if_ether.h>
 
 static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 };
@@ -129,7 +130,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
 		/* Tx buf allocation may fail sometimes, so sleep and retry. */
 		res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ), true);
 		if (res == _FAIL) {
-			msleep(10);
+			fsleep(10 * USEC_PER_MSEC);
 			res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ), true);
 			if (res == _FAIL)
 				goto exit;
-- 
2.53.0
Re: [PATCH v3 2/2] staging: rtl8723bs: Replace msleep() with fsleep()
Posted by Ethan Tidmore 3 weeks, 1 day ago
On Sat Mar 14, 2026 at 9:09 PM CDT, Marcos Andrade wrote:
> Replace msleep(10) with fsleep(10 * USEC_PER_MSEC) in _rtw_init_xmit_priv().
> fsleep() is the new standard API for delays, as it automatically chooses
> the best sleep method based on the duration.
>
> Suggested-by: Ethan Tidmore <ethantidmore06@gmail.com>
> Signed-off-by: Marcos Andrade <marcosandrade95963@gmail.com>
> ---

$ ./scripts/checkpatch.pl --strict -g HEAD
WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#6:
Replace msleep(10) with fsleep(10 * USEC_PER_MSEC) in _rtw_init_xmit_priv().

Remember to always run "./scripts/checkpatch.pl --strict <patch>" before
sending a patch off to catch things like this.

Thanks,

ET