summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRashika Kheria <rashika.kheria@gmail.com>2013-10-15 14:37:00 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-15 15:41:08 (GMT)
commit17cba02f9a1bd4c1a904352b52e060230fb454be (patch)
tree8ad22fb026e8478436b3a24db7f4aaf3615bbcec /drivers
parent2c856b9e3e06fa731f70458924a449928fec7dfc (diff)
downloadlinux-fsl-qoriq-17cba02f9a1bd4c1a904352b52e060230fb454be.tar.xz
Staging: btmtk_usb: Fix Sparse Warning of incorrect casting
This patch fixes the following Sparse Warnings in btmtk_usb.c: drivers/staging/btmtk_usb/btmtk_usb.c:110:16: warning: cast to restricted __le32 drivers/staging/btmtk_usb/btmtk_usb.c:299:23: warning: cast to restricted __le16 Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/btmtk_usb/btmtk_usb.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/staging/btmtk_usb/btmtk_usb.c b/drivers/staging/btmtk_usb/btmtk_usb.c
index 1b0f993..cb315b5 100644
--- a/drivers/staging/btmtk_usb/btmtk_usb.c
+++ b/drivers/staging/btmtk_usb/btmtk_usb.c
@@ -93,6 +93,7 @@ static int btmtk_usb_io_read32(struct btmtk_usb_data *data, u32 reg, u32 *val)
u8 request = data->r_request;
struct usb_device *udev = data->udev;
int ret;
+ __le32 val_le;
ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), request,
DEVICE_VENDOR_REQUEST_IN, 0x0, reg, data->io_buf,
@@ -105,9 +106,9 @@ static int btmtk_usb_io_read32(struct btmtk_usb_data *data, u32 reg, u32 *val)
return ret;
}
- memmove(val, data->io_buf, 4);
+ memmove(&val_le, data->io_buf, 4);
- *val = le32_to_cpu(*val);
+ *val = le32_to_cpu(val_le);
if (ret > 0)
ret = 0;
@@ -280,6 +281,7 @@ static u16 btmtk_usb_get_crc(struct btmtk_usb_data *data)
int ret = 0;
struct usb_device *udev = data->udev;
u16 crc, count = 0;
+ __le16 crc_le;
BT_DBG("%s\n", __func__);
@@ -294,9 +296,9 @@ static u16 btmtk_usb_get_crc(struct btmtk_usb_data *data)
BT_ERR("%s error(%d)\n", __func__, ret);
}
- memmove(&crc, data->io_buf, 2);
+ memmove(&crc_le, data->io_buf, 2);
- crc = le16_to_cpu(crc);
+ crc = le16_to_cpu(crc_le);
if (crc != 0xFFFF)
break;