mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gaston Gonzalez <gascoar@gmail.com>
To: gregkh@linuxfoundation.org, cristina.opriceana@gmail.com,
	hamohammed.sa@gmail.com, gdonald@gmail.com,
	mahfouz.saif.elyazal@gmail.com, paul.gortmaker@windriver.com
Cc: cvijaydh@visteon.com, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org, gascoar@gmail.com
Subject: [PATCH] staging: rtl8192u: ieee80211: Fix sparse endianness warnings ieee80211_softmac.c
Date: Wed, 10 Jun 2015 19:46:25 -0300	[thread overview]
Message-ID: <1433976385-21724-1-git-send-email-gascoar@gmail.com> (raw)

Fix the following endinness warnings detected by sparse:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:669:34: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:669:34:    expected restricted __le16 [usertype] duration_id
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:669:34:    got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:679:33: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:679:33:    expected restricted __le16 [usertype] algorithm
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:679:33:    got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1090:32: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1090:32:    expected restricted __le16 [usertype] duration_id
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1090:32:    got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1109:30: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1109:30:    expected restricted __le16 [usertype] listen_interval
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1109:30:    got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:3130:24: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:3130:24:    expected restricted __le16 [usertype] reason
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:3130:24:    got unsigned char [unsigned] [usertype] asRsn

Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index b00f5fd..5fbade4 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -666,7 +666,7 @@ inline struct sk_buff *ieee80211_authentication_req(struct ieee80211_network *be
 	else
 		auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
 
-	auth->header.duration_id = 0x013a; //FIXME
+	auth->header.duration_id = cpu_to_le16(0x013a);
 
 	memcpy(auth->header.addr1, beacon->bssid, ETH_ALEN);
 	memcpy(auth->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
@@ -676,7 +676,7 @@ inline struct sk_buff *ieee80211_authentication_req(struct ieee80211_network *be
 	if(ieee->auth_mode == 0)
 		auth->algorithm = WLAN_AUTH_OPEN;
 	else if(ieee->auth_mode == 1)
-		auth->algorithm = WLAN_AUTH_SHARED_KEY;
+		auth->algorithm = cpu_to_le16(WLAN_AUTH_SHARED_KEY);
 	else if(ieee->auth_mode == 2)
 		auth->algorithm = WLAN_AUTH_OPEN;//0x80;
 	printk("=================>%s():auth->algorithm is %d\n",__func__,auth->algorithm);
@@ -1087,7 +1087,7 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco
 
 
 	hdr->header.frame_ctl = IEEE80211_STYPE_ASSOC_REQ;
-	hdr->header.duration_id= 37; //FIXME
+	hdr->header.duration_id = cpu_to_le16(37);
 	memcpy(hdr->header.addr1, beacon->bssid, ETH_ALEN);
 	memcpy(hdr->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
 	memcpy(hdr->header.addr3, beacon->bssid, ETH_ALEN);
@@ -1106,7 +1106,7 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco
 	if (wmm_info_len) //QOS
 		hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_QOS);
 
-	hdr->listen_interval = 0xa; //FIXME
+	hdr->listen_interval = cpu_to_le16(0xa);
 
 	hdr->info_element[0].id = MFIE_TYPE_SSID;
 
@@ -3127,7 +3127,7 @@ inline struct sk_buff *ieee80211_disassociate_skb(
 	memcpy(disass->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
 	memcpy(disass->header.addr3, beacon->bssid, ETH_ALEN);
 
-	disass->reason = asRsn;
+	disass->reason = cpu_to_le16(asRsn);
 	return skb;
 }
 
-- 
2.4.2


                 reply	other threads:[~2015-06-10 22:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433976385-21724-1-git-send-email-gascoar@gmail.com \
    --to=gascoar@gmail.com \
    --cc=cristina.opriceana@gmail.com \
    --cc=cvijaydh@visteon.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gdonald@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mahfouz.saif.elyazal@gmail.com \
    --cc=paul.gortmaker@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome