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

Sascha Hauer s.hauer at pengutronix.de
Fri Oct 2 01:07:13 PDT 2015


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 at gmail.com>
> ---
>  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 |



More information about the barebox mailing list