Re: [PATCH] usb: core: drop unnecessary le16_to_cpu() conversion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 02, 2015 at 10:23:30AM +0300, Antony Pavlov wrote:
> In drivers/usb/core/usb.c we already have le16_to_cpus() conversion
> just after usb_get_descriptor():
> 
>     390     /* correct le values */
>     391     le16_to_cpus(&dev->descriptor->bcdUSB);
>     392     le16_to_cpus(&dev->descriptor->idVendor);
>     393     le16_to_cpus(&dev->descriptor->idProduct);
>     394     le16_to_cpus(&dev->descriptor->bcdDevice);
> 
> so no additional idVendor/idProduct descriptor fields
> le16_to_cpu() conversion is needed after that.
> 
> On the big-endian machines extra le16_to_cpu() conversion
> leads to wrong idVendor/idProduct USB device parameters values
> (e.g. see devinfo <usb-device> output), and to a much more
> serious problem: idVendor/idProduct-based USB device detection
> does not work.
> 
> Signed-off-by: Antony Pavlov <antonynpavlov@xxxxxxxxx>
> ---
>  drivers/usb/core/usb.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux