Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Al Viro and committed by
Linus Torvalds
6b8588f7 24caa6a0

+5 -5
+1 -1
drivers/input/joystick/iforce/iforce-usb.c
··· 159 159 160 160 iforce->cr.bRequestType = USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_INTERFACE; 161 161 iforce->cr.wIndex = 0; 162 - iforce->cr.wLength = 16; 162 + iforce->cr.wLength = cpu_to_le16(16); 163 163 164 164 usb_fill_int_urb(iforce->irq, dev, usb_rcvintpipe(dev, epirq->bEndpointAddress), 165 165 iforce->data, 16, iforce_usb_irq, iforce, epirq->bInterval);
+4 -4
drivers/input/tablet/gtco.c
··· 897 897 dbg("Extra descriptor success: type:%d len:%d", 898 898 hid_desc->bDescriptorType, hid_desc->wDescriptorLength); 899 899 900 - report = kzalloc(hid_desc->wDescriptorLength, GFP_KERNEL); 900 + report = kzalloc(le16_to_cpu(hid_desc->wDescriptorLength), GFP_KERNEL); 901 901 if (!report) { 902 902 err("No more memory for report"); 903 903 error = -ENOMEM; ··· 913 913 REPORT_DEVICE_TYPE << 8, 914 914 0, /* interface */ 915 915 report, 916 - hid_desc->wDescriptorLength, 916 + le16_to_cpu(hid_desc->wDescriptorLength), 917 917 5000); /* 5 secs */ 918 918 919 - if (result == hid_desc->wDescriptorLength) 919 + if (result == le16_to_cpu(hid_desc->wDescriptorLength)) 920 920 break; 921 921 } 922 922 923 923 /* If we didn't get the report, fail */ 924 924 dbg("usb_control_msg result: :%d", result); 925 - if (result != hid_desc->wDescriptorLength) { 925 + if (result != le16_to_cpu(hid_desc->wDescriptorLength)) { 926 926 err("Failed to get HID Report Descriptor of size: %d", 927 927 hid_desc->wDescriptorLength); 928 928 error = -EIO;