linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] drivers/iio/gyro/mpu3050-core.c: This patch fix the following checkpatch warning.
@ 2019-04-14 15:53 Mohan Kumar
  2019-04-16 11:50 ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Mohan Kumar @ 2019-04-14 15:53 UTC (permalink / raw)
  To: linus.walleij; +Cc: jic23, knaack.h, linux-iio, linux-kernel

As per Documentation/timers/timers-howto.txt Msleep < 20ms can sleep for
up to 20ms. so use usleep_range.

Signed-off-by: Mohan Kumar <mohankumar718@gmail.com>
---
 drivers/iio/gyro/mpu3050-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c
index 85b7ac4..0a40616 100644
--- a/drivers/iio/gyro/mpu3050-core.c
+++ b/drivers/iio/gyro/mpu3050-core.c
@@ -865,7 +865,7 @@ static int mpu3050_power_up(struct mpu3050 *mpu3050)
 		dev_err(mpu3050->dev, "error setting power mode\n");
 		return ret;
 	}
-	msleep(10);
+	usleep_range(10000, 20000);
 
 	return 0;
 }
-- 
2.7.4


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

* Re: [RESEND PATCH] drivers/iio/gyro/mpu3050-core.c: This patch fix the following checkpatch warning.
  2019-04-14 15:53 [RESEND PATCH] drivers/iio/gyro/mpu3050-core.c: This patch fix the following checkpatch warning Mohan Kumar
@ 2019-04-16 11:50 ` Linus Walleij
  2019-04-22  9:45   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2019-04-16 11:50 UTC (permalink / raw)
  To: Mohan Kumar; +Cc: Jonathan Cameron, Hartmut Knaack, linux-iio, linux-kernel

On Sun, Apr 14, 2019 at 5:53 PM Mohan Kumar <mohankumar718@gmail.com> wrote:

> As per Documentation/timers/timers-howto.txt Msleep < 20ms can sleep for
> up to 20ms. so use usleep_range.
>
> Signed-off-by: Mohan Kumar <mohankumar718@gmail.com>

All right, should work as fine.
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [RESEND PATCH] drivers/iio/gyro/mpu3050-core.c: This patch fix the following checkpatch warning.
  2019-04-16 11:50 ` Linus Walleij
@ 2019-04-22  9:45   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2019-04-22  9:45 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Mohan Kumar, Hartmut Knaack, linux-iio, linux-kernel

On Tue, 16 Apr 2019 13:50:18 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:

> On Sun, Apr 14, 2019 at 5:53 PM Mohan Kumar <mohankumar718@gmail.com> wrote:
> 
> > As per Documentation/timers/timers-howto.txt Msleep < 20ms can sleep for
> > up to 20ms. so use usleep_range.
> >
> > Signed-off-by: Mohan Kumar <mohankumar718@gmail.com>  
> 
> All right, should work as fine.
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
Thanks and applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

Whilst we are here, there is a 'false' warning that we should clear up at
somepoint (from sparse)

CHECK   drivers/iio/gyro/mpu3050-core.c
drivers/iio/gyro/mpu3050-core.c:544:48: warning: incorrect type in assignment (different base types)
drivers/iio/gyro/mpu3050-core.c:544:48:    expected restricted __be16 <noident>
drivers/iio/gyro/mpu3050-core.c:544:48:    got int

Line in question is setting the __be16 value to 0xAAAA where endian choice has
no effect.  I'll send out the trivial 'fix' in a minute.  Give the compiler
can sort it out at build time it should make no actual difference.

Usual arguments apply for why we bother to suppress 'false' build warnings
like this...

Anyhow patch shortly.

Jonathan



> 
> Yours,
> Linus Walleij


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

end of thread, other threads:[~2019-04-22  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-14 15:53 [RESEND PATCH] drivers/iio/gyro/mpu3050-core.c: This patch fix the following checkpatch warning Mohan Kumar
2019-04-16 11:50 ` Linus Walleij
2019-04-22  9:45   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).