net: cdc_ncm: big endian fix
authorBjørn Mork <bjorn@mork.no>
Thu, 25 Oct 2012 21:44:08 +0000 (21:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 28 Oct 2012 23:07:57 +0000 (19:07 -0400)
Probably doesn't matter much since the value is used as a
boolean anyway, but it removes the sparse warning:

 drivers/net/usb/cdc_ncm.c:1090:32: warning: incorrect type in assignment (different base types)
 drivers/net/usb/cdc_ncm.c:1090:32:    expected unsigned short [unsigned] [usertype] connected
 drivers/net/usb/cdc_ncm.c:1090:32:    got restricted __le16 [usertype] wValue

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/cdc_ncm.c

index d0ea419..397de63 100644 (file)
@@ -1064,7 +1064,7 @@ static void cdc_ncm_status(struct usbnet *dev, struct urb *urb)
                 * USB_CDC_NOTIFY_NETWORK_CONNECTION notification shall be
                 * sent by device after USB_CDC_NOTIFY_SPEED_CHANGE.
                 */
-               ctx->connected = event->wValue;
+               ctx->connected = le16_to_cpu(event->wValue);
 
                printk(KERN_INFO KBUILD_MODNAME ": %s: network connection:"
                        " %sconnected\n",