Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1729872

[PATCH 3.2 014/106] USB: iowarrior: fix info ioctl on big-endian hosts

From Ben Hutchings <ben@decadent.org.uk>
Newsgroups linux.kernel
Subject [PATCH 3.2 014/106] USB: iowarrior: fix info ioctl on big-endian hosts
Date 2017-09-10 01:50 +0200
Message-ID <unXFD-43x-7@gated-at.bofh.it> (permalink)
References <unWqe-3ep-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


3.2.93-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Johan Hovold <johan@kernel.org>

commit dd5ca753fa92fb736b1395db892bd29f78e6d408 upstream.

Drop 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.")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/misc/iowarrior.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -560,7 +560,7 @@ static long iowarrior_ioctl(struct file
 			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;
 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 3.2 000/106] 3.2.93-rc1 review Ben Hutchings <ben@decadent.org.uk> - 2017-09-10 01:00 +0200
  [PATCH 3.2 017/106] USB: gadget: dummy_hcd: fix hub-descriptor  removable fields Ben Hutchings <ben@decadent.org.uk> - 2017-09-10 01:00 +0200
  [PATCH 3.2 090/106] rtnetlink: add IFLA_GROUP to ifla_policy Ben Hutchings <ben@decadent.org.uk> - 2017-09-10 01:00 +0200
  [PATCH 3.2 014/106] USB: iowarrior: fix info ioctl on big-endian  hosts Ben Hutchings <ben@decadent.org.uk> - 2017-09-10 01:50 +0200
  [PATCH 3.2 002/106] af_key: Fix slab-out-of-bounds in  pfkey_compile_policy. Ben Hutchings <ben@decadent.org.uk> - 2017-09-10 01:50 +0200
  [PATCH 3.2 009/106] ahci: Acer SA5-271 SSD Not Detected Fix Ben Hutchings <ben@decadent.org.uk> - 2017-09-10 01:50 +0200
  [PATCH 3.2 001/106] xfrm: fix stack access out of bounds with  CONFIG_XFRM_SUB_POLICY Ben Hutchings <ben@decadent.org.uk> - 2017-09-10 01:50 +0200
  Re: [PATCH 3.2 000/106] 3.2.93-rc1 review Guenter Roeck <linux@roeck-us.net> - 2017-09-10 16:40 +0200
    Re: [PATCH 3.2 000/106] 3.2.93-rc1 review Ben Hutchings <ben@decadent.org.uk> - 2017-09-10 20:50 +0200

csiph-web