提交 bcf59e2c 编写于 作者: D Dan Carpenter 提交者: David Vrabel

uwb: remove duplicate cpu_to_le16()

These parameters should be passed as cpu endian because we change it to
little endian inside usb_control_msg().  On x86 cpu_to_le16() doesn't
do anything so either way works but I think the original code would break
on big endian systems.

I removed the masks as well because that usb_control_msg() parameters
are __u16 so we already only use the lower bits.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NDavid Vrabel <david.vrabel@csr.com>
上级 03806fa2
...@@ -120,8 +120,7 @@ int i1480_usb_write(struct i1480 *i1480, u32 memory_address, ...@@ -120,8 +120,7 @@ int i1480_usb_write(struct i1480 *i1480, u32 memory_address,
result = usb_control_msg( result = usb_control_msg(
i1480_usb->usb_dev, usb_sndctrlpipe(i1480_usb->usb_dev, 0), i1480_usb->usb_dev, usb_sndctrlpipe(i1480_usb->usb_dev, 0),
0xf0, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 0xf0, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
cpu_to_le16(memory_address & 0xffff), memory_address, (memory_address >> 16),
cpu_to_le16((memory_address >> 16) & 0xffff),
i1480->cmd_buf, buffer_size, 100 /* FIXME: arbitrary */); i1480->cmd_buf, buffer_size, 100 /* FIXME: arbitrary */);
if (result < 0) if (result < 0)
break; break;
...@@ -166,8 +165,7 @@ int i1480_usb_read(struct i1480 *i1480, u32 addr, size_t size) ...@@ -166,8 +165,7 @@ int i1480_usb_read(struct i1480 *i1480, u32 addr, size_t size)
result = usb_control_msg( result = usb_control_msg(
i1480_usb->usb_dev, usb_rcvctrlpipe(i1480_usb->usb_dev, 0), i1480_usb->usb_dev, usb_rcvctrlpipe(i1480_usb->usb_dev, 0),
0xf0, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 0xf0, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
cpu_to_le16(itr_addr & 0xffff), itr_addr, (itr_addr >> 16),
cpu_to_le16((itr_addr >> 16) & 0xffff),
i1480->cmd_buf + itr, itr_size, i1480->cmd_buf + itr, itr_size,
100 /* FIXME: arbitrary */); 100 /* FIXME: arbitrary */);
if (result < 0) { if (result < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册