* [PATCH] iio:gyro:mp3050 Suppress 'false' sparse warning about endian assigment.
@ 2019-04-22 10:00 jic23
0 siblings, 0 replies; only message in thread
From: jic23 @ 2019-04-22 10:00 UTC (permalink / raw)
To: linux-iio; +Cc: Jonathan Cameron, Linus Walleij
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
In this particular case the value being assigned is 0xAAAA so
is not effected by the endian choice.
It's easy to suppress so we might as well do so to make it easier
to spot real warnings.
Warning is:
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
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
---
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 496ed4c99ce9..9aacaca145e4 100644
--- a/drivers/iio/gyro/mpu3050-core.c
+++ b/drivers/iio/gyro/mpu3050-core.c
@@ -541,7 +541,7 @@ static irqreturn_t mpu3050_trigger_handler(int irq, void *p)
toread = bytes_per_datum;
offset = 1;
/* Put in some dummy value */
- fifo_values[0] = 0xAAAA;
+ fifo_values[0] = cpu_to_be16(0xAAAA);
}
ret = regmap_bulk_read(mpu3050->map,
--
2.21.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-04-22 10:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-22 10:00 [PATCH] iio:gyro:mp3050 Suppress 'false' sparse warning about endian assigment jic23
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).