mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 00:20:32 +00:00
usb input endianness annotations and fixes
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
24caa6a0c7
commit
6b8588f718
2 changed files with 5 additions and 5 deletions
|
@ -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.bRequestType = USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_INTERFACE;
|
||||||
iforce->cr.wIndex = 0;
|
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),
|
usb_fill_int_urb(iforce->irq, dev, usb_rcvintpipe(dev, epirq->bEndpointAddress),
|
||||||
iforce->data, 16, iforce_usb_irq, iforce, epirq->bInterval);
|
iforce->data, 16, iforce_usb_irq, iforce, epirq->bInterval);
|
||||||
|
|
|
@ -897,7 +897,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
|
||||||
dbg("Extra descriptor success: type:%d len:%d",
|
dbg("Extra descriptor success: type:%d len:%d",
|
||||||
hid_desc->bDescriptorType, hid_desc->wDescriptorLength);
|
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) {
|
if (!report) {
|
||||||
err("No more memory for report");
|
err("No more memory for report");
|
||||||
error = -ENOMEM;
|
error = -ENOMEM;
|
||||||
|
@ -913,16 +913,16 @@ static int gtco_probe(struct usb_interface *usbinterface,
|
||||||
REPORT_DEVICE_TYPE << 8,
|
REPORT_DEVICE_TYPE << 8,
|
||||||
0, /* interface */
|
0, /* interface */
|
||||||
report,
|
report,
|
||||||
hid_desc->wDescriptorLength,
|
le16_to_cpu(hid_desc->wDescriptorLength),
|
||||||
5000); /* 5 secs */
|
5000); /* 5 secs */
|
||||||
|
|
||||||
if (result == hid_desc->wDescriptorLength)
|
if (result == le16_to_cpu(hid_desc->wDescriptorLength))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we didn't get the report, fail */
|
/* If we didn't get the report, fail */
|
||||||
dbg("usb_control_msg result: :%d", result);
|
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",
|
err("Failed to get HID Report Descriptor of size: %d",
|
||||||
hid_desc->wDescriptorLength);
|
hid_desc->wDescriptorLength);
|
||||||
error = -EIO;
|
error = -EIO;
|
||||||
|
|
Loading…
Reference in a new issue