diff mbox

[OPW,kernel] staging:rtl8192u:Fix sparse warning incorrect type in assignment

Message ID 1414499554-27545-1-git-send-email-dilekuzulmez@gmail.com
State New, archived
Headers show

Commit Message

Dilek Uzulmez Oct. 28, 2014, 12:32 p.m. UTC
This patch fixes the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:572:37: warning:
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:572:37:    expected
unsigned short [unsigned] [usertype] len
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:572:37:    got
restricted __be16 [usertype] <noident>
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1333:45: warning:
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1333:45:    expected
unsigned short [unsigned] [usertype] len
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1333:45:    got
restricted __be16 [usertype] <noident>

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Greg KH Oct. 29, 2014, 7:38 a.m. UTC | #1
On Tue, Oct 28, 2014 at 02:32:34PM +0200, Dilek Uzulmez wrote:
> This patch fixes the following sparse warnings:
> 
> drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:572:37: warning:
> incorrect type in assignment (different base types)
> drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:572:37:    expected
> unsigned short [unsigned] [usertype] len
> drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:572:37:    got
> restricted __be16 [usertype] <noident>
> drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1333:45: warning:
> incorrect type in assignment (different base types)
> drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1333:45:    expected
> unsigned short [unsigned] [usertype] len
> drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1333:45:    got
> restricted __be16 [usertype] <noident>
> 
> Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
> ---
>  drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
> index 73de9e9..ba84686 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
> @@ -569,7 +569,7 @@ void ieee80211_indicate_packets(struct ieee80211_device *ieee, struct ieee80211_
>  			} else {
>  				u16 len;
>  			/* Leave Ethernet header part of hdr and full payload */
> -				len = htons(sub_skb->len);
> +				len = sub_skb->len;
>  				memcpy(skb_push(sub_skb, 2), &len, 2);
>  				memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src, ETH_ALEN);
>  				memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, ETH_ALEN);
> @@ -1330,7 +1330,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
>  				} else {
>  					u16 len;
>  					/* Leave Ethernet header part of hdr and full payload */
> -					len = htons(sub_skb->len);
> +					len = sub_skb->len;

Again, you changed the logic here, I can't take this :(
diff mbox

Patch

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 73de9e9..ba84686 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -569,7 +569,7 @@  void ieee80211_indicate_packets(struct ieee80211_device *ieee, struct ieee80211_
 			} else {
 				u16 len;
 			/* Leave Ethernet header part of hdr and full payload */
-				len = htons(sub_skb->len);
+				len = sub_skb->len;
 				memcpy(skb_push(sub_skb, 2), &len, 2);
 				memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src, ETH_ALEN);
 				memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, ETH_ALEN);
@@ -1330,7 +1330,7 @@  int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 				} else {
 					u16 len;
 					/* Leave Ethernet header part of hdr and full payload */
-					len = htons(sub_skb->len);
+					len = sub_skb->len;
 					memcpy(skb_push(sub_skb, 2), &len, 2);
 					memcpy(skb_push(sub_skb, ETH_ALEN), src, ETH_ALEN);
 					memcpy(skb_push(sub_skb, ETH_ALEN), dst, ETH_ALEN);