Re: [PATCH] staging: wlan-ng: cast to restricted __le16

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 29, 2016 at 11:54:03AM +0300, Ebru Akagunduz wrote:
> This patch uses __le16 data type to fix le16_to_cpu()
> cast warnings which is found by sparse.
> 
> Signed-off-by: Ebru Akagunduz <ebru.akagunduz@xxxxxxxxx>
> ---
>  drivers/staging/wlan-ng/hfa384x.h | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h
> index 4cf4796..1fe1acf 100644
> --- a/drivers/staging/wlan-ng/hfa384x.h
> +++ b/drivers/staging/wlan-ng/hfa384x.h
> @@ -357,7 +357,7 @@ struct hfa384x_bytestr {
>  } __packed;
>  
>  typedef struct hfa384x_bytestr32 {
> -	u16 len;
> +	__le16 len;
>  	u8 data[32];
>  } __packed hfa384x_bytestr32_t;
>  
> @@ -672,16 +672,16 @@ typedef struct hfa384x_ChInfoResult {
>  
>  /*--  Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/
>  typedef struct hfa384x_HScanResultSub {
> -	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;
>  	hfa384x_bytestr32_t ssid;
>  	u8 supprates[10];	/* 802.11 info element */
>  	u16 proberesp_rate;
> -	u16 atim;
> +	__le16 atim;
>  } __packed hfa384x_HScanResultSub_t;

Are you sure these are all really little-endian values?  How do you know
this?

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux