[OPW,kernel] staging:go7007:Replace msleep() with usleep_range for <20ms timer
diff mbox

Message ID 20131009085139.GA17463@dshgna
State Rejected
Headers show

Commit Message

Dulshani Gunawardhana Oct. 9, 2013, 8:51 a.m. UTC
Replace msleep() with usleep_range() for <20ms timer in go7007-usb.c

Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
---
 drivers/staging/media/go7007/go7007-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dulshani Gunawardhana Oct. 9, 2013, 8:54 a.m. UTC | #1
Not so sure if I did the fix correctly. I referred to the timers-howto in 
the Documentations as suggested in checkpatch and used usleep_range(10, 12) 
instead of msleep. Am a bit confused if the range I gave to usleep_range is 
ok.

Thanks :)

. Replace msleep() with usleep_range() for <20ms timer in go7007-usb.c 
>
>
>
Greg KH Oct. 11, 2013, 8:38 p.m. UTC | #2
On Wed, Oct 09, 2013 at 02:21:45PM +0530, Dulshani Gunawardhana wrote:
> Replace msleep() with usleep_range() for <20ms timer in go7007-usb.c
> 
> Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
> ---
>  drivers/staging/media/go7007/go7007-usb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/go7007/go7007-usb.c b/drivers/staging/media/go7007/go7007-usb.c
> index 23529f6..a356192 100644
> --- a/drivers/staging/media/go7007/go7007-usb.c
> +++ b/drivers/staging/media/go7007/go7007-usb.c
> @@ -704,7 +704,7 @@ static int go7007_usb_ezusb_write_interrupt(struct go7007 *go,
>  		status_reg = le16_to_cpu(*((u16 *)go->usb_buf));
>  		if (!(status_reg & 0x0010))
>  			break;
> -		msleep(10);
> +		usleep_range(10, 12);

You just changed the driver from asking to sleep for 10 milliseconds, to
10-12 microseconds, a big difference :(

While checkpatch does complain about this, this driver has so many other
problems that I really wouldn't worry about it.  I keep wanting to just
delete the driver, as the hardware that I had that used it is long
broken, but it's hanging around as the video-for-linux maintainers are
willing to keep it working, in case someone uses it still.

So don't worry about this warning here, it's safe to leave alone for
now.

thanks,

greg k-h
Dulshani Gunawardhana Oct. 15, 2013, 3:42 p.m. UTC | #3
I'd like to make the change and resubmit, but is it not required :) ?

Also would be very grateful if you could give some pointers to some 
critical drivers that need modifying. 

Thanks :)

>
> You just changed the driver from asking to sleep for 10 milliseconds, to 
> 10-12 microseconds, a big difference :( 
>
> While checkpatch does complain about this, this driver has so many other 
> it, but is it n
> problems that I really wouldn't worry about it.  I keep wanting to just 
> delete the driver, as the hardware that I had that used it is long 
> broken, but it's hanging around as the video-for-linux maintainers are 
> willing to keep it working, in case someone uses it still. 
>
> So don't worry about this warning here, it's safe to leave alone for 
> now. 
>
> thanks, 
>
> greg k-h 
>
Greg KH Oct. 15, 2013, 3:52 p.m. UTC | #4
A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

On Tue, Oct 15, 2013 at 08:42:59AM -0700, Dulshani Gunawardhana wrote:
> I'd like to make the change and resubmit, but is it not required :) ?

That is correct, it is not required.

> Also would be very grateful if you could give some pointers to some critical
> drivers that need modifying.

What do you mean by "critical"?  All of the drivers in the
drivers/staging/ tree need work to fix up, look at the TODO files in
them for hints on what needs to be done.

greg k-h

Patch
diff mbox

diff --git a/drivers/staging/media/go7007/go7007-usb.c b/drivers/staging/media/go7007/go7007-usb.c
index 23529f6..a356192 100644
--- a/drivers/staging/media/go7007/go7007-usb.c
+++ b/drivers/staging/media/go7007/go7007-usb.c
@@ -704,7 +704,7 @@  static int go7007_usb_ezusb_write_interrupt(struct go7007 *go,
 		status_reg = le16_to_cpu(*((u16 *)go->usb_buf));
 		if (!(status_reg & 0x0010))
 			break;
-		msleep(10);
+		usleep_range(10, 12);
 	}
 	if (r < 0)
 		goto write_int_error;