Skip to contentSkip to conversation

drivers/iio/gyro/mpu3050-core.c: This patch fix the following checkpatch warning.

PATCH RESEND In review Mohan Kumar 3 participants 3 messages Apr 14, 2019 – Apr 22, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 drivers/iio/gyro/mpu3050-core.c: This patch fix the following checkpatch warning.

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

---
 drivers/iio/gyro/mpu3050-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/gyro/mpu3050-core.c +1 -1
index 85b7ac4..0a40616 100644
@@ -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;
 }
Signature · 1 line
2.7.4
maintainer
#2 lore raw
Quoted 9 lines · On Tue, 16 Apr 2019 13:50:18 +0200 Linus Walleij <[email protected]>…
Quoted 4 lines · Mohan Kumar

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

All right, should work as fine.

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

Quoted 3 lines

Yours,
Linus Walleij