diff mbox series

iio: gyro: mpu3050: Explicity make a 'poison' value big endian

Message ID 20191013100255.1445528-1-jic23@kernel.org (mailing list archive)
State New, archived
Headers show
Series iio: gyro: mpu3050: Explicity make a 'poison' value big endian | expand

Commit Message

Jonathan Cameron Oct. 13, 2019, 10:02 a.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This clearly has no actual affect but it does show sparse and similar
static analysers that we are doing this intentionally.

CHECK   drivers/iio/gyro/mpu3050-core.c
drivers/iio/gyro/mpu3050-core.c:546:48: warning: incorrect type in assignment (different base types)
drivers/iio/gyro/mpu3050-core.c:546:48:    expected restricted __be16 <noident>
drivers/iio/gyro/mpu3050-core.c:546: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(-)

Comments

Linus Walleij Oct. 16, 2019, 12:19 p.m. UTC | #1
On Sun, Oct 13, 2019 at 12:05 PM <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This clearly has no actual affect but it does show sparse and similar
> static analysers that we are doing this intentionally.
>
> CHECK   drivers/iio/gyro/mpu3050-core.c
> drivers/iio/gyro/mpu3050-core.c:546:48: warning: incorrect type in assignment (different base types)
> drivers/iio/gyro/mpu3050-core.c:546:48:    expected restricted __be16 <noident>
> drivers/iio/gyro/mpu3050-core.c:546:48:    got int
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Jonathan Cameron Oct. 18, 2019, 6:55 p.m. UTC | #2
On Wed, 16 Oct 2019 14:19:46 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:

> On Sun, Oct 13, 2019 at 12:05 PM <jic23@kernel.org> wrote:
> 
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > This clearly has no actual affect but it does show sparse and similar
> > static analysers that we are doing this intentionally.
> >
> > CHECK   drivers/iio/gyro/mpu3050-core.c
> > drivers/iio/gyro/mpu3050-core.c:546:48: warning: incorrect type in assignment (different base types)
> > drivers/iio/gyro/mpu3050-core.c:546:48:    expected restricted __be16 <noident>
> > drivers/iio/gyro/mpu3050-core.c:546:48:    got int
> >
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Linus Walleij <linus.walleij@linaro.org>  
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> 
> Yours,
> Linus Walleij
Applied. Thanks,

Jonathan
diff mbox series

Patch

diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c
index 80154bca18b6..8e908a749f95 100644
--- a/drivers/iio/gyro/mpu3050-core.c
+++ b/drivers/iio/gyro/mpu3050-core.c
@@ -543,7 +543,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,