Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH] Staging: wfx: CHECK: usleep_range is preferred over udelay
@ 2022-02-07 16:00 Leonardo Araujo
  2022-02-07 16:46 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Leonardo Araujo @ 2022-02-07 16:00 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-staging, Leonardo Araujo

Fixes the checks reported by checkpatch.pl for usleep_range.

Signed-off-by: Leonardo Araujo <leonardo.aa88@gmail.com>
---
 drivers/staging/wfx/bh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
index a0f9d1b53019..ebc7eaf93ef0 100644
--- a/drivers/staging/wfx/bh.c
+++ b/drivers/staging/wfx/bh.c
@@ -312,7 +312,7 @@ void wfx_bh_poll_irq(struct wfx_dev *wdev)
 			dev_err(wdev->dev, "time out while polling control register\n");
 			return;
 		}
-		udelay(200);
+		usleep_range(200, 200);
 	}
 	wfx_bh_request_rx(wdev);
 }
-- 
2.29.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Staging: wfx: CHECK: usleep_range is preferred over udelay
  2022-02-07 16:00 [PATCH] Staging: wfx: CHECK: usleep_range is preferred over udelay Leonardo Araujo
@ 2022-02-07 16:46 ` Greg KH
  2022-02-07 17:28   ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2022-02-07 16:46 UTC (permalink / raw)
  To: Leonardo Araujo; +Cc: linux-kernel, linux-staging

On Mon, Feb 07, 2022 at 01:00:51PM -0300, Leonardo Araujo wrote:
> Fixes the checks reported by checkpatch.pl for usleep_range.
> 
> Signed-off-by: Leonardo Araujo <leonardo.aa88@gmail.com>
> ---
>  drivers/staging/wfx/bh.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
> index a0f9d1b53019..ebc7eaf93ef0 100644
> --- a/drivers/staging/wfx/bh.c
> +++ b/drivers/staging/wfx/bh.c
> @@ -312,7 +312,7 @@ void wfx_bh_poll_irq(struct wfx_dev *wdev)
>  			dev_err(wdev->dev, "time out while polling control register\n");
>  			return;
>  		}
> -		udelay(200);
> +		usleep_range(200, 200);

Do you have the hardware to verify that this is the correct fix for
this?

You can not just blindly make this type of change here, sorry, otherwise
we would have done so long ago with a simple search/replace :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Staging: wfx: CHECK: usleep_range is preferred over udelay
  2022-02-07 16:46 ` Greg KH
@ 2022-02-07 17:28   ` Joe Perches
  0 siblings, 0 replies; 3+ messages in thread
From: Joe Perches @ 2022-02-07 17:28 UTC (permalink / raw)
  To: Greg KH, Leonardo Araujo; +Cc: linux-kernel, linux-staging

On Mon, 2022-02-07 at 17:46 +0100, Greg KH wrote:
> On Mon, Feb 07, 2022 at 01:00:51PM -0300, Leonardo Araujo wrote:
> > Fixes the checks reported by checkpatch.pl for usleep_range.
[]
> > diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
[]
> > @@ -312,7 +312,7 @@ void wfx_bh_poll_irq(struct wfx_dev *wdev)
> >  			dev_err(wdev->dev, "time out while polling control register\n");
> >  			return;
> >  		}
> > -		udelay(200);
> > +		usleep_range(200, 200);

range with the same low/high values is pretty useless.

And Leonardo, checkpatch should have warned you about this.
You, as a novice kernel submitter, should always use it on patches
you create before you send them out for review.

> Do you have the hardware to verify that this is the correct fix for
> this?
> 
> You can not just blindly make this type of change here, sorry, otherwise
> we would have done so long ago with a simple search/replace :)

Greg, you keep writing this but treewide search/replace is almost never done.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-07 17:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-07 16:00 [PATCH] Staging: wfx: CHECK: usleep_range is preferred over udelay Leonardo Araujo
2022-02-07 16:46 ` Greg KH
2022-02-07 17:28   ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox