]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: rtl8723bs: replace msleep() with fsleep() in rtw_cmd.c
authorJose A. Perez de Azpillaga <azpijr@gmail.com>
Fri, 27 Feb 2026 08:46:12 +0000 (09:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Mar 2026 16:03:17 +0000 (17:03 +0100)
Replace msleep() with fsleep() in rtw_cmd.c to improve delay
precision and follow modern kernel practices.

Specifically, this fixes a checkpatch warning for the 10ms delay
in _rtw_free_evt_priv() and updates the 100ms polling loops in
rtw_chk_hi_queue_hdl() and rtw_free_cmd_priv() for consistency.

Signed-off-by: Jose A. Perez de Azpillaga <azpijr@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260227084623.209913-1-azpijr@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_cmd.c

index 5d9b192805c9db2c50750761d50efdcefa4c2fdf..8cd2fdbe417d64c05289a56c1bcd8e34019c4260 100644 (file)
@@ -8,6 +8,7 @@
 #include <hal_btcoex.h>
 #include <linux/jiffies.h>
 #include <linux/align.h>
+#include <linux/delay.h>
 
 static struct _cmd_callback rtw_cmd_callback[] = {
        {GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/
@@ -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);
+               fsleep(10 * USEC_PER_MSEC);
 
        while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
                void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);
@@ -1502,7 +1503,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
        rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty);
 
        while (!empty && jiffies_to_msecs(jiffies - start) < g_wait_hiq_empty) {
-               msleep(100);
+               fsleep(100 * USEC_PER_MSEC);
                rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty);
        }