Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: iio: Fix sparse endian warning

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>

authored by

Ksenija Stanojevic and committed by
Greg Kroah-Hartman
87787e5e 29efdd3d

+3 -2
+3 -2
drivers/staging/iio/adc/ad7606_spi.c
··· 21 21 { 22 22 struct spi_device *spi = to_spi_device(dev); 23 23 int i, ret; 24 - unsigned short *data = buf; 24 + unsigned short *data; 25 + __be16 *bdata = buf; 25 26 26 27 ret = spi_read(spi, buf, count * 2); 27 28 if (ret < 0) { ··· 31 30 } 32 31 33 32 for (i = 0; i < count; i++) 34 - data[i] = be16_to_cpu(data[i]); 33 + data[i] = be16_to_cpu(bdata[i]); 35 34 36 35 return 0; 37 36 }