USB: chaoskey: fix Alea quirk on big-endian hosts
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/2 USB: chaoskey: fix Alea quirk on big-endian hosts
Add missing endianness conversion when applying the Alea timeout quirk.
Found using sparse:
warning: restricted __le16 degrades to integer
Fixes e4a886e811cd ("hwrng: chaoskey - Fix URB warning due to timeout on Alea")
Cc stable <[email protected]> # 4.8
Cc Bob Ham <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Keith Packard <[email protected]>
Signed-off-by Johan Hovold <[email protected]>
--- drivers/usb/misc/chaoskey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/misc/chaoskey.c +1 -1
@@ -192,7 +192,7 @@ static int chaoskey_probe(struct usb_interface *interface, dev->in_ep = in_ep; -if (udev->descriptor.idVendor !=ALEA_VENDOR_ID ) +if (le16_to_cpu (udev->descriptor.idVendor) !=ALEA_VENDOR_ID ) dev->reads_started =1 ; dev->size = size;
Signature · 1 line
2.13.0
PATCH 2/2 USB: iowarrior: fix info ioctl on big-endian hosts
In reply to a message not in the archiveDrop erroneous le16_to_cpu when returning the USB device speed which is already in host byte order.
Found using sparse:
warning: cast to restricted __le16
Fixes 946b960d13c1 ("USB: add driver for iowarrior devices.")
Cc stable <[email protected]> # 2.6.21
Signed-off-by Johan Hovold <[email protected]>
--- drivers/usb/misc/iowarrior.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/misc/iowarrior.c +1 -1
@@ -554,7 +554,7 @@ static long iowarrior_ioctl(struct file *file, unsigned int cmd, info.revision =le16_to_cpu (dev->udev->descriptor.bcdDevice);/* 0==UNKNOWN, 1==LOW(usb1.1) ,2=FULL(usb1.1), 3=HIGH(usb2.0) */ - info.speed =le16_to_cpu (dev->udev->speed); + info.speed = dev->udev->speed; info.if_num = dev->interface->cur_altsetting->desc.bInterfaceNumber; info.report_size = dev->report_size;
Signature · 1 line
2.13.0