staging: wlan-ng: Fix struct definition's and variable type
authorSuniel Mahesh <sunil.m@techveda.org>
Fri, 16 Jun 2017 05:31:45 +0000 (11:01 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Jun 2017 17:37:38 +0000 (19:37 +0200)
le16_to_cpu() accepts argument of type __le16 and cpu_to_le16()
returns an argument of type __le16. This patch fixes:
(a) the type of the variable that end's up getting return from
    cpu_to_le16().
(b) the member types of struct hfa384x_host_scan_request_data,
    struct hfa384x_bytestr32 and struct hfa384x_hscan_result_sub.

The following type mismatch warnings reported by sparse
have been fixed:
warning: incorrect type in assignment (different base types)
warning: cast to restricted __le16

Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/hfa384x.h
drivers/staging/wlan-ng/prism2mgmt.c

index 60110b4..018db22 100644 (file)
@@ -358,7 +358,7 @@ struct hfa384x_bytestr {
 } __packed;
 
 struct hfa384x_bytestr32 {
-       u16 len;
+       __le16 len;
        u8 data[32];
 } __packed;
 
@@ -399,8 +399,8 @@ struct hfa384x_caplevel {
 
 /*-- Configuration Record: HostScanRequest (data portion only) --*/
 struct hfa384x_host_scan_request_data {
-       u16 channel_list;
-       u16 tx_rate;
+       __le16 channel_list;
+       __le16 tx_rate;
        struct hfa384x_bytestr32 ssid;
 } __packed;
 
@@ -682,16 +682,16 @@ struct hfa384x_ch_info_result {
 
 /*--  Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/
 struct hfa384x_hscan_result_sub {
-       u16 chid;
-       u16 anl;
-       u16 sl;
+       __le16 chid;
+       __le16 anl;
+       __le16 sl;
        u8 bssid[WLAN_BSSID_LEN];
-       u16 bcnint;
-       u16 capinfo;
+       __le16 bcnint;
+       __le16 capinfo;
        struct hfa384x_bytestr32 ssid;
        u8 supprates[10];       /* 802.11 info element */
        u16 proberesp_rate;
-       u16 atim;
+       __le16 atim;
 } __packed;
 
 struct hfa384x_hscan_result {
index f4d6e48..c4aa9e7 100644 (file)
@@ -213,7 +213,7 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp)
                goto exit;
        }
        if (word == HFA384x_PORTSTATUS_DISABLED) {
-               u16 wordbuf[17];
+               __le16 wordbuf[17];
 
                result = hfa384x_drvr_setconfig16(hw,
                                        HFA384x_RID_CNFROAMINGMODE,