Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: wlan-ng: Fix struct definition's and variable type

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>

authored by

Suniel Mahesh and committed by
Greg Kroah-Hartman
18cd9021 428715ba

+10 -10
+9 -9
drivers/staging/wlan-ng/hfa384x.h
··· 358 358 } __packed; 359 359 360 360 struct hfa384x_bytestr32 { 361 - u16 len; 361 + __le16 len; 362 362 u8 data[32]; 363 363 } __packed; 364 364 ··· 399 399 400 400 /*-- Configuration Record: HostScanRequest (data portion only) --*/ 401 401 struct hfa384x_host_scan_request_data { 402 - u16 channel_list; 403 - u16 tx_rate; 402 + __le16 channel_list; 403 + __le16 tx_rate; 404 404 struct hfa384x_bytestr32 ssid; 405 405 } __packed; 406 406 ··· 682 682 683 683 /*-- Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/ 684 684 struct hfa384x_hscan_result_sub { 685 - u16 chid; 686 - u16 anl; 687 - u16 sl; 685 + __le16 chid; 686 + __le16 anl; 687 + __le16 sl; 688 688 u8 bssid[WLAN_BSSID_LEN]; 689 - u16 bcnint; 690 - u16 capinfo; 689 + __le16 bcnint; 690 + __le16 capinfo; 691 691 struct hfa384x_bytestr32 ssid; 692 692 u8 supprates[10]; /* 802.11 info element */ 693 693 u16 proberesp_rate; 694 - u16 atim; 694 + __le16 atim; 695 695 } __packed; 696 696 697 697 struct hfa384x_hscan_result {
+1 -1
drivers/staging/wlan-ng/prism2mgmt.c
··· 213 213 goto exit; 214 214 } 215 215 if (word == HFA384x_PORTSTATUS_DISABLED) { 216 - u16 wordbuf[17]; 216 + __le16 wordbuf[17]; 217 217 218 218 result = hfa384x_drvr_setconfig16(hw, 219 219 HFA384x_RID_CNFROAMINGMODE,