提交 90e6228a 编写于 作者: K Ksenija Stanojevic 提交者: Greg Kroah-Hartman

Staging: comedi: das16: Fix sparse endian warning

Fix following sparse warning:
warning: cast to restricted __le16

This change is safe because array is pointer of type void and can
be used to store any type of data, also offset of the array would
be the same since unsigned short and __le16 are both 16 bits in size.
Signed-off-by: NKsenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 8005c49d
......@@ -801,9 +801,10 @@ static void das16_ai_munge(struct comedi_device *dev,
unsigned short *data = array;
unsigned int num_samples = comedi_bytes_to_samples(s, num_bytes);
unsigned int i;
__le16 *buf = array;
for (i = 0; i < num_samples; i++) {
data[i] = le16_to_cpu(data[i]);
data[i] = le16_to_cpu(buf[i]);
if (s->maxdata == 0x0fff)
data[i] >>= 4;
data[i] &= s->maxdata;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册