Skip to content

Commit

Permalink
Staging: iio: Fix sparse endian warning
Browse files Browse the repository at this point in the history
Fix following sparse warning:
warning: cast to restricted __be16

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ksenija Stanojevic authored and Greg Kroah-Hartman committed Mar 28, 2016
1 parent 29efdd3 commit 87787e5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/staging/iio/adc/ad7606_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}
Expand Down

0 comments on commit 87787e5

Please sign in to comment.