mirror of https://gitee.com/openkylin/linux.git
staging: comedi: dt9812: Resolves sparse endian warnings.
Resolves warnings from the "sparse" checker of the form "warning: cast to restricted __le??". Signed-off-by: Shaun Laing <shaun@xresource.ca> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e71042f241
commit
e4ea910a48
|
@ -707,8 +707,9 @@ static int dt9812_reset_device(struct comedi_device *dev)
|
|||
u32 serial;
|
||||
u16 vendor;
|
||||
u16 product;
|
||||
u16 tmp16;
|
||||
u8 tmp8;
|
||||
__le16 tmp16;
|
||||
__le32 tmp32;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
|
@ -731,19 +732,19 @@ static int dt9812_reset_device(struct comedi_device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
ret = dt9812_read_info(dev, 1, &vendor, sizeof(vendor));
|
||||
ret = dt9812_read_info(dev, 1, &tmp16, sizeof(tmp16));
|
||||
if (ret) {
|
||||
dev_err(dev->class_dev, "failed to read vendor id\n");
|
||||
return ret;
|
||||
}
|
||||
vendor = le16_to_cpu(vendor);
|
||||
vendor = le16_to_cpu(tmp16);
|
||||
|
||||
ret = dt9812_read_info(dev, 3, &product, sizeof(product));
|
||||
ret = dt9812_read_info(dev, 3, &tmp16, sizeof(tmp16));
|
||||
if (ret) {
|
||||
dev_err(dev->class_dev, "failed to read product id\n");
|
||||
return ret;
|
||||
}
|
||||
product = le16_to_cpu(product);
|
||||
product = le16_to_cpu(tmp16);
|
||||
|
||||
ret = dt9812_read_info(dev, 5, &tmp16, sizeof(tmp16));
|
||||
if (ret) {
|
||||
|
@ -752,12 +753,12 @@ static int dt9812_reset_device(struct comedi_device *dev)
|
|||
}
|
||||
devpriv->device = le16_to_cpu(tmp16);
|
||||
|
||||
ret = dt9812_read_info(dev, 7, &serial, sizeof(serial));
|
||||
ret = dt9812_read_info(dev, 7, &tmp32, sizeof(tmp32));
|
||||
if (ret) {
|
||||
dev_err(dev->class_dev, "failed to read serial number\n");
|
||||
return ret;
|
||||
}
|
||||
serial = le32_to_cpu(serial);
|
||||
serial = le32_to_cpu(tmp32);
|
||||
|
||||
/* let the user know what node this device is now attached to */
|
||||
dev_info(dev->class_dev, "USB DT9812 (%4.4x.%4.4x.%4.4x) #0x%8.8x\n",
|
||||
|
|
Loading…
Reference in New Issue