summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-02-23 15:04:23 +0300
committerDavid Vrabel <david.vrabel@csr.com>2010-02-25 13:38:51 +0000
commitbcf59e2c4dea780e4abf48d5e673f5d79f9ee064 (patch)
tree3bddb355fdadef0c3be34cadcbdf9dbfbfc27acd
parent03806fa20f6a081493a731a4b18ea66317f9f947 (diff)
downloadop-kernel-dev-bcf59e2c4dea780e4abf48d5e673f5d79f9ee064.zip
op-kernel-dev-bcf59e2c4dea780e4abf48d5e673f5d79f9ee064.tar.gz
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: Dan Carpenter <error27@gmail.com> Signed-off-by: David Vrabel <david.vrabel@csr.com>
-rw-r--r--drivers/uwb/i1480/dfu/usb.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/uwb/i1480/dfu/usb.c b/drivers/uwb/i1480/dfu/usb.c
index a6a9375..a99e211 100644
--- a/drivers/uwb/i1480/dfu/usb.c
+++ b/drivers/uwb/i1480/dfu/usb.c
@@ -120,8 +120,7 @@ int i1480_usb_write(struct i1480 *i1480, u32 memory_address,
result = usb_control_msg(
i1480_usb->usb_dev, usb_sndctrlpipe(i1480_usb->usb_dev, 0),
0xf0, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
- cpu_to_le16(memory_address & 0xffff),
- cpu_to_le16((memory_address >> 16) & 0xffff),
+ memory_address, (memory_address >> 16),
i1480->cmd_buf, buffer_size, 100 /* FIXME: arbitrary */);
if (result < 0)
break;
@@ -166,8 +165,7 @@ int i1480_usb_read(struct i1480 *i1480, u32 addr, size_t size)
result = usb_control_msg(
i1480_usb->usb_dev, usb_rcvctrlpipe(i1480_usb->usb_dev, 0),
0xf0, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
- cpu_to_le16(itr_addr & 0xffff),
- cpu_to_le16((itr_addr >> 16) & 0xffff),
+ itr_addr, (itr_addr >> 16),
i1480->cmd_buf + itr, itr_size,
100 /* FIXME: arbitrary */);
if (result < 0) {
OpenPOWER on IntegriCloud