Skip to content

Commit

Permalink
usb input endianness annotations and fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Al Viro authored and Linus Torvalds committed Apr 28, 2008
1 parent 24caa6a commit 6b8588f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/input/joystick/iforce/iforce-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static int iforce_usb_probe(struct usb_interface *intf,

iforce->cr.bRequestType = USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_INTERFACE;
iforce->cr.wIndex = 0;
iforce->cr.wLength = 16;
iforce->cr.wLength = cpu_to_le16(16);

usb_fill_int_urb(iforce->irq, dev, usb_rcvintpipe(dev, epirq->bEndpointAddress),
iforce->data, 16, iforce_usb_irq, iforce, epirq->bInterval);
Expand Down
8 changes: 4 additions & 4 deletions drivers/input/tablet/gtco.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
dbg("Extra descriptor success: type:%d len:%d",
hid_desc->bDescriptorType, hid_desc->wDescriptorLength);

report = kzalloc(hid_desc->wDescriptorLength, GFP_KERNEL);
report = kzalloc(le16_to_cpu(hid_desc->wDescriptorLength), GFP_KERNEL);
if (!report) {
err("No more memory for report");
error = -ENOMEM;
Expand All @@ -913,16 +913,16 @@ static int gtco_probe(struct usb_interface *usbinterface,
REPORT_DEVICE_TYPE << 8,
0, /* interface */
report,
hid_desc->wDescriptorLength,
le16_to_cpu(hid_desc->wDescriptorLength),
5000); /* 5 secs */

if (result == hid_desc->wDescriptorLength)
if (result == le16_to_cpu(hid_desc->wDescriptorLength))
break;
}

/* If we didn't get the report, fail */
dbg("usb_control_msg result: :%d", result);
if (result != hid_desc->wDescriptorLength) {
if (result != le16_to_cpu(hid_desc->wDescriptorLength)) {
err("Failed to get HID Report Descriptor of size: %d",
hid_desc->wDescriptorLength);
error = -EIO;
Expand Down

0 comments on commit 6b8588f

Please sign in to comment.