Commit 87787e5e authored by Ksenija Stanojevic's avatar Ksenija Stanojevic Committed by Greg Kroah-Hartman

Staging: iio: Fix sparse endian warning

Fix following sparse warning:
warning: cast to restricted __be16
Signed-off-by: default avatarKsenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 29efdd3d
...@@ -21,7 +21,8 @@ static int ad7606_spi_read_block(struct device *dev, ...@@ -21,7 +21,8 @@ static int ad7606_spi_read_block(struct device *dev,
{ {
struct spi_device *spi = to_spi_device(dev); struct spi_device *spi = to_spi_device(dev);
int i, ret; int i, ret;
unsigned short *data = buf; unsigned short *data;
__be16 *bdata = buf;
ret = spi_read(spi, buf, count * 2); ret = spi_read(spi, buf, count * 2);
if (ret < 0) { if (ret < 0) {
...@@ -30,7 +31,7 @@ static int ad7606_spi_read_block(struct device *dev, ...@@ -30,7 +31,7 @@ static int ad7606_spi_read_block(struct device *dev,
} }
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
data[i] = be16_to_cpu(data[i]); data[i] = be16_to_cpu(bdata[i]);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment