Skip to contentSkip to conversation

iio:gyro:mp3050 Suppress 'false' sparse warning about endian assigment.

PATCH New [email protected] 1 participant 1 message Apr 22, 2019

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 iio:gyro:mp3050 Suppress 'false' sparse warning about endian assigment.

From: Jonathan Cameron <[email protected]>

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

---
 drivers/iio/gyro/mpu3050-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/gyro/mpu3050-core.c +1 -1
index 496ed4c99ce9..9aacaca145e4 100644
@@ -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,
Signature · 1 line
2.21.0