From: Ksenija Stanojevic Date: Wed, 23 Mar 2016 11:06:34 +0000 (+0100) Subject: Staging: iio: Fix sparse endian warning X-Git-Tag: v4.14-rc1~3181^2~546 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=87787e5ef727ff15f7c552cc48823b469f2eb41b;p=platform%2Fkernel%2Flinux-rpi.git Staging: iio: Fix sparse endian warning Fix following sparse warning: warning: cast to restricted __be16 Signed-off-by: Ksenija Stanojevic Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/adc/ad7606_spi.c b/drivers/staging/iio/adc/ad7606_spi.c index d873a51..825da07 100644 --- a/drivers/staging/iio/adc/ad7606_spi.c +++ b/drivers/staging/iio/adc/ad7606_spi.c @@ -21,7 +21,8 @@ static int ad7606_spi_read_block(struct device *dev, { struct spi_device *spi = to_spi_device(dev); int i, ret; - unsigned short *data = buf; + unsigned short *data; + __be16 *bdata = buf; ret = spi_read(spi, buf, count * 2); if (ret < 0) { @@ -30,7 +31,7 @@ static int ad7606_spi_read_block(struct device *dev, } for (i = 0; i < count; i++) - data[i] = be16_to_cpu(data[i]); + data[i] = be16_to_cpu(bdata[i]); return 0; }