staging: wlan-ng: prism2mib.c: Fix type cast issues
authorOlav Haugan <ohaugan@codeaurora.org>
Tue, 13 Jun 2017 21:14:46 +0000 (14:14 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jun 2017 10:26:41 +0000 (12:26 +0200)
Fix the following sparse warnings:

prism2mib.c:717:45: warning: cast to restricted __le16
prism2mib.c:720:45: warning: incorrect type in assignment (different base types)
prism2mib.c:720:45:    expected unsigned short [unsigned] [addressable] [usertype] datalen
prism2mib.c:720:45:    got restricted __le16 [usertype] <noident>
prism2mib.c:755:22: warning: incorrect type in assignment (different base types)
prism2mib.c:755:22:    expected unsigned short [unsigned] [usertype] len
prism2mib.c:755:22:    got restricted __le16 [usertype] <noident>

Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/hfa384x.h
drivers/staging/wlan-ng/prism2mib.c

index 310e2c4545907dcf176d862d46dcd4d37fcc8604..60110b4b49f87c29dbb9a666bdb934bef2a3d416 100644 (file)
 /*-------------------------------------------------------------*/
 /* Commonly used basic types */
 struct hfa384x_bytestr {
-       u16 len;
+       __le16 len;
        u8 data[0];
 } __packed;
 
@@ -419,7 +419,7 @@ struct hfa384x_authenticate_station_data {
 
 /*-- Configuration Record: WPAData       (data portion only) --*/
 struct hfa384x_wpa_data {
-       u16 datalen;
+       __le16 datalen;
        u8 data[0];             /* max 80 */
 } __packed;
 
index 28df1f3d6f4af2eb9149e8fa4439cf671608116a..e41207d973091a6ca76402833d1bd46addf497c5 100644 (file)
@@ -774,7 +774,7 @@ void prism2mgmt_pstr2bytestr(struct hfa384x_bytestr *bytestr,
 void prism2mgmt_bytestr2pstr(struct hfa384x_bytestr *bytestr,
                             struct p80211pstrd *pstr)
 {
-       pstr->len = (u8)(le16_to_cpu((u16)(bytestr->len)));
+       pstr->len = (u8)(le16_to_cpu(bytestr->len));
        memcpy(pstr->data, bytestr->data, pstr->len);
 }