diff options
author | Thomas Pugliese <thomas.pugliese@gmail.com> | 2013-10-07 19:07:51 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-19 16:19:21 +0400 |
commit | 1653d2f88f43f6780eace1faeeb7b7adde8c10fb (patch) | |
tree | 0848ebaf8648b8ed15abf40356cd2166038fce8e /drivers/usb/host/hwa-hc.c | |
parent | 679ee475a1c19243c8f50a5a76f6b7519b24c1a3 (diff) | |
download | linux-1653d2f88f43f6780eace1faeeb7b7adde8c10fb.tar.xz |
usb: wusbcore: preserve endianness of cached descriptors
Do not overwrite the multi-byte fields of usb_wa_descriptor with their
cpu format values after reading the descriptor. Leave the values as
__le16 and swap on use. This is more consistent with other uses of USB
descriptors.
Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/hwa-hc.c')
-rw-r--r-- | drivers/usb/host/hwa-hc.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/usb/host/hwa-hc.c b/drivers/usb/host/hwa-hc.c index e58b92491eb1..e5fb3cfd57a9 100644 --- a/drivers/usb/host/hwa-hc.c +++ b/drivers/usb/host/hwa-hc.c @@ -570,14 +570,10 @@ found: goto error; } wa->wa_descr = wa_descr = (struct usb_wa_descriptor *) hdr; - /* Make LE fields CPU order */ - wa_descr->bcdWAVersion = le16_to_cpu(wa_descr->bcdWAVersion); - wa_descr->wNumRPipes = le16_to_cpu(wa_descr->wNumRPipes); - wa_descr->wRPipeMaxBlock = le16_to_cpu(wa_descr->wRPipeMaxBlock); - if (wa_descr->bcdWAVersion > 0x0100) + if (le16_to_cpu(wa_descr->bcdWAVersion) > 0x0100) dev_warn(dev, "Wire Adapter v%d.%d newer than groked v1.0\n", - wa_descr->bcdWAVersion & 0xff00 >> 8, - wa_descr->bcdWAVersion & 0x00ff); + le16_to_cpu(wa_descr->bcdWAVersion) & 0xff00 >> 8, + le16_to_cpu(wa_descr->bcdWAVersion) & 0x00ff); result = 0; error: return result; |