Linux kernel staging patches
 help / color / mirror / Atom feed
From: Serhat Kumral <serhatkumral1@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Serhat Kumral <serhatkumral1@gmail.com>
Subject: [PATCH 3/3] staging: rtl8723bs: use usleep_range instead of msleep for short delays
Date: Sun, 21 Jun 2026 13:40:58 +0300	[thread overview]
Message-ID: <20260621104058.7408-3-serhatkumral1@gmail.com> (raw)
In-Reply-To: <20260621104058.7408-1-serhatkumral1@gmail.com>

Replace msleep(10) and msleep(1) with usleep_range(10000, 20000) and
usleep_range(1000, 2000) respectively in os_intfs.c, because msleep is
imprecise and discouraged for short delays under 20ms.
This fixes the checkpatch.pl warnings:
WARNING: msleep < 20ms can sleep for up to 20ms; see function description of msleep().

Signed-off-by: Serhat Kumral <serhatkumral1@gmail.com>
---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index 89e41c26e..5e41f518a 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -986,7 +986,7 @@ void rtw_dev_unload(struct adapter *padapter)
 			if (cnt > 5)
 				break;
 			cnt++;
-			msleep(10);
+			usleep_range(10000, 20000);
 		}
 
 		/* check the status of IPS */
@@ -1086,7 +1086,7 @@ void rtw_suspend_common(struct adapter *padapter)
 	pwrpriv->bInSuspend = true;
 
 	while (pwrpriv->bips_processing)
-		msleep(1);
+		usleep_range(1000, 2000);
 
 	if ((!padapter->bup) || (padapter->bDriverStopped) || (padapter->bSurpriseRemoved))
 		return;
-- 
2.54.0


  parent reply	other threads:[~2026-06-21 10:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-21 10:40 [PATCH 1/3] staging: rtl8723bs: remove multiple blank lines Serhat Kumral
2026-06-21 10:40 ` [PATCH 2/3] staging: rtl8723bs: put logical continuation on previous line Serhat Kumral
2026-06-21 10:40 ` Serhat Kumral [this message]
2026-06-22  9:07   ` [PATCH 3/3] staging: rtl8723bs: use usleep_range instead of msleep for short delays Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260621104058.7408-3-serhatkumral1@gmail.com \
    --to=serhatkumral1@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox