mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Antony Pavlov <antonynpavlov@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] usb: core: drop unnecessary le16_to_cpu() conversion
Date: Fri, 2 Oct 2015 10:07:13 +0200	[thread overview]
Message-ID: <20151002080713.GQ7858@pengutronix.de> (raw)
In-Reply-To: <1443770610-24469-1-git-send-email-antonynpavlov@gmail.com>

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@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 |

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

      reply	other threads:[~2015-10-02  8:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-02  7:23 Antony Pavlov
2015-10-02  8:07 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151002080713.GQ7858@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox