Skip to contentSkip to conversation

staging: rtl8723bs: replace msleep with usleep_range

PATCH In review sluisr 3 participants 3 messages Mar 9 Staging

lore
Share & tools
lore

sluisr

author
#0 lore raw

PATCH 1/1 staging: rtl8723bs: replace msleep with usleep_range

This patch addresses the checkpatch.pl warnings:
WARNING: msleep < 20ms can sleep for up to 20ms; see function description of msleep().

It is recommended to use usleep_range for delays less than 20ms.

---
 drivers/staging/rtl8723bs/core/rtw_cmd.c      | 2 +-
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +-
 drivers/staging/rtl8723bs/core/rtw_pwrctrl.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +1 -1
index abb84f8ae..f6293f049 100644
@@ -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);
 
 	while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
 		void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +1 -1
index b1f20aa81..7ac013519 100644
@@ -5833,7 +5833,7 @@ u8 chk_bmc_sleepq_hdl(struct adapter *padapter, unsigned char *pbuf)
 		return H2C_SUCCESS;
 
 	if ((pstapriv->tim_bitmap & BIT(0)) && (psta_bmc->sleepq_len > 0)) {
-		msleep(10);/*  10ms, ATIM(HIQ) Windows */
+		usleep_range(10000, 11000);/*  10ms, ATIM(HIQ) Windows */
 
 		/* spin_lock_bh(&psta_bmc->sleep_q.lock); */
 		spin_lock_bh(&pxmitpriv->lock);
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +1 -1
index 1c9e02732..ad6c375ba 100644
@@ -420,7 +420,7 @@ s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
 			err = -1;
 			break;
 		}
-		msleep(1);
+		usleep_range(1000, 2000);
 	}
 
 	return err;
Signature · 1 line
2.53.0
maintainer
#2 lore raw
In reply to sluisr
Quoted 55 lines · sluisr

This patch addresses the checkpatch.pl warnings:
WARNING: msleep < 20ms can sleep for up to 20ms; see function description of msleep().

It is recommended to use usleep_range for delays less than 20ms.

---
 drivers/staging/rtl8723bs/core/rtw_cmd.c      | 2 +-
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +-
 drivers/staging/rtl8723bs/core/rtw_pwrctrl.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +1 -1
index abb84f8ae..f6293f049 100644
@@ -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);
 
 	while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
 		void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +1 -1
index b1f20aa81..7ac013519 100644
@@ -5833,7 +5833,7 @@ u8 chk_bmc_sleepq_hdl(struct adapter *padapter, unsigned char *pbuf)
 		return H2C_SUCCESS;
 
 	if ((pstapriv->tim_bitmap & BIT(0)) && (psta_bmc->sleepq_len > 0)) {
-		msleep(10);/*  10ms, ATIM(HIQ) Windows */
+		usleep_range(10000, 11000);/*  10ms, ATIM(HIQ) Windows */
 
 		/* spin_lock_bh(&psta_bmc->sleep_q.lock); */
 		spin_lock_bh(&pxmitpriv->lock);
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +1 -1
index 1c9e02732..ad6c375ba 100644
@@ -420,7 +420,7 @@ s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
 			err = -1;
 			break;
 		}
-		msleep(1);
+		usleep_range(1000, 2000);
 	}
 
 	return err;
Signature · 1 line
2.53.0

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.

You are receiving this message because of the following common error(s) as indicated below:

- It looks like you did not use your "real" name for the patch on either the Signed-off-by: line, or the From: line (both of which have to match). Please read the kernel file, Documentation/process/submitting-patches.rst for how to do this correctly.

- You sent a patch that has been sent multiple times in the past few days, and is identical to ones that has been recently rejected. Please always look at the mailing list traffic to determine if you are duplicating other people's work.

If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.

thanks,

greg k-h's patch email bot