diff mbox

[OPW,kernel] staging:wlan-ng:Fix sparse warning cast to restricted __le16

Message ID 20140304224253.GA27185@himangi-Inspiron-N5110gmail.com
State New, archived
Headers show

Commit Message

HIMANGI SARAOGI March 4, 2014, 10:42 p.m. UTC
This patch fixes the following sparse warnings:
drivers/staging/wlan-ng/hfa384x_usb.c:3582:14: warning: cast to
restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3584:19: warning: cast to
restricted __le16

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
---
 drivers/staging/wlan-ng/hfa384x_usb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Paul E. McKenney March 4, 2014, 10:56 p.m. UTC | #1
On Wed, Mar 05, 2014 at 04:12:53AM +0530, Himangi Saraogi wrote:
> This patch fixes the following sparse warnings:
> drivers/staging/wlan-ng/hfa384x_usb.c:3582:14: warning: cast to
> restricted __le16
> drivers/staging/wlan-ng/hfa384x_usb.c:3584:19: warning: cast to
> restricted __le16
> 
> Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
> ---
>  drivers/staging/wlan-ng/hfa384x_usb.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
> index 5b8b094..b16f97c 100644
> --- a/drivers/staging/wlan-ng/hfa384x_usb.c
> +++ b/drivers/staging/wlan-ng/hfa384x_usb.c
> @@ -3579,9 +3579,9 @@ static void hfa384x_int_rxmonitor(wlandevice_t *wlandev,
> 
>  	/* Remember the status, time, and data_len fields are in host order */
>  	/* Figure out how big the frame is */
> -	fc = le16_to_cpu(rxdesc->frame_control);
> +	fc = rxdesc->frame_control;

This change looks to me like it will break big-endian platforms.  My guess
is that the "frame_control" and "data_len" fields need __le16 tags on them.
See block/partitions/efi.h for example uses of this tag.

							Thanx, Paul

>  	hdrlen = p80211_headerlen(fc);
> -	datalen = le16_to_cpu(rxdesc->data_len);
> +	datalen = rxdesc->data_len;
> 
>  	/* Allocate an ind message+framesize skb */
>  	skblen = sizeof(struct p80211_caphdr) + hdrlen + datalen + WLAN_CRC_LEN;
> -- 
> 1.7.9.5
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
diff mbox

Patch

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index 5b8b094..b16f97c 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -3579,9 +3579,9 @@  static void hfa384x_int_rxmonitor(wlandevice_t *wlandev,
 
 	/* Remember the status, time, and data_len fields are in host order */
 	/* Figure out how big the frame is */
-	fc = le16_to_cpu(rxdesc->frame_control);
+	fc = rxdesc->frame_control;
 	hdrlen = p80211_headerlen(fc);
-	datalen = le16_to_cpu(rxdesc->data_len);
+	datalen = rxdesc->data_len;
 
 	/* Allocate an ind message+framesize skb */
 	skblen = sizeof(struct p80211_caphdr) + hdrlen + datalen + WLAN_CRC_LEN;