* [PATCH] staging:rtl8188eu Fix msleep < 20ms can sleep upto 20ms
@ 2017-09-05 10:06 Janani Sankara Babu
2017-09-05 14:14 ` Greg KH
2017-09-05 14:16 ` Joe Perches
0 siblings, 2 replies; 3+ messages in thread
From: Janani Sankara Babu @ 2017-09-05 10:06 UTC (permalink / raw)
To: gregkh; +Cc: goudapatilk, insafonov, devel, linux-kernel, Janani Sankara Babu
This patch solves the following warning shown by checkpatch script
Warning: msleep < 20ms can sleep for up to 20ms
Signed-off-by: Janani Sankara Babu <jananis37@gmail.com>
---
drivers/staging/rtl8188eu/core/rtw_pwrctrl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
index f86c9ce..78edc15 100644
--- a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
@@ -436,7 +436,7 @@ s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
DBG_88E("%s: Wait for FW LPS leave more than %u ms!!!\n", __func__, delay_ms);
break;
}
- msleep(1);
+ usleep_range(0, 1000);
}
return err;
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] staging:rtl8188eu Fix msleep < 20ms can sleep upto 20ms
2017-09-05 10:06 [PATCH] staging:rtl8188eu Fix msleep < 20ms can sleep upto 20ms Janani Sankara Babu
@ 2017-09-05 14:14 ` Greg KH
2017-09-05 14:16 ` Joe Perches
1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2017-09-05 14:14 UTC (permalink / raw)
To: Janani Sankara Babu; +Cc: devel, goudapatilk, insafonov, linux-kernel
On Tue, Sep 05, 2017 at 03:36:41PM +0530, Janani Sankara Babu wrote:
> This patch solves the following warning shown by checkpatch script
> Warning: msleep < 20ms can sleep for up to 20ms
>
> Signed-off-by: Janani Sankara Babu <jananis37@gmail.com>
> ---
> drivers/staging/rtl8188eu/core/rtw_pwrctrl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
> index f86c9ce..78edc15 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
> @@ -436,7 +436,7 @@ s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
> DBG_88E("%s: Wait for FW LPS leave more than %u ms!!!\n", __func__, delay_ms);
> break;
> }
> - msleep(1);
> + usleep_range(0, 1000);
How do you know this is a valid range to sleep for?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging:rtl8188eu Fix msleep < 20ms can sleep upto 20ms
2017-09-05 10:06 [PATCH] staging:rtl8188eu Fix msleep < 20ms can sleep upto 20ms Janani Sankara Babu
2017-09-05 14:14 ` Greg KH
@ 2017-09-05 14:16 ` Joe Perches
1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2017-09-05 14:16 UTC (permalink / raw)
To: Janani Sankara Babu, gregkh; +Cc: goudapatilk, insafonov, devel, linux-kernel
On Tue, 2017-09-05 at 15:36 +0530, Janani Sankara Babu wrote:
> This patch solves the following warning shown by checkpatch script
> Warning: msleep < 20ms can sleep for up to 20ms
[]
> diff --git a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
[]
> @@ -436,7 +436,7 @@ s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
> DBG_88E("%s: Wait for FW LPS leave more than %u ms!!!\n", __func__, delay_ms);
> break;
> }
> - msleep(1);
> + usleep_range(0, 1000);
No, that would sleep a random time up to 1 ms.
usleep_range(1000, 2000) might be OK but please
check the value passed as delay_ms.
It's only used as LPS_LEAVE_TIMEOUT_MS (100 here)
so it seems just fine to keep using msleep.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-05 14:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-05 10:06 [PATCH] staging:rtl8188eu Fix msleep < 20ms can sleep upto 20ms Janani Sankara Babu
2017-09-05 14:14 ` Greg KH
2017-09-05 14:16 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox