]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: wlan-ng: Avoid bogus endianness
authorAviya Erenfeld <aviyae42@gmail.com>
Mon, 11 Sep 2017 22:51:10 +0000 (01:51 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Sep 2017 14:35:28 +0000 (16:35 +0200)
The linkstatus variable in the info struct received as __le16
but handled in every other place in the driver as u16

Fix that and remove the sparse warning that occurred due to it:
prism2sta.c:1450:29: warning: incorrect type in assignment (different base types)
prism2sta.c:1450:29:    expected unsigned short [unsigned] [usertype] link_status_new
prism2sta.c:1450:29:    got restricted __le16 [usertype] linkstatus

Signed-off-by: Aviya Erenfeld <aviyae42@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/prism2sta.c

index c9df45063ab36338e175a8476a37e990759ddcb8..070a237004cb16e747ad40110b2cd18dfe05ed94 100644 (file)
@@ -1447,7 +1447,7 @@ static void prism2sta_inf_linkstatus(struct wlandevice *wlandev,
 {
        struct hfa384x *hw = wlandev->priv;
 
-       hw->link_status_new = inf->info.linkstatus.linkstatus;
+       hw->link_status_new = le16_to_cpu(inf->info.linkstatus.linkstatus);
 
        schedule_work(&hw->link_bh);
 }