Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1545337

[PATCH 11/13] staging: rtl8712: changed cast to __le16

From Jannik Becher <becher.jannik@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 11/13] staging: rtl8712: changed cast to __le16
Date 2016-12-20 19:10 +0100
Message-ID <sQx1o-ys-23@gated-at.bofh.it> (permalink)
References <sQx1o-ys-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Fixed sparse warning.
Changed u16 to __le16

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/staging/rtl8712/ieee80211.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8712/ieee80211.c b/drivers/staging/rtl8712/ieee80211.c
index 5dc3b5b..ccf8ba6 100644
--- a/drivers/staging/rtl8712/ieee80211.c
+++ b/drivers/staging/rtl8712/ieee80211.c
@@ -174,16 +174,16 @@ int r8712_generate_ie(struct registry_priv *pregistrypriv)
 	sz += 8;
 	ie += sz;
 	/*beacon interval : 2bytes*/
-	*(u16 *)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);
+	*(__le16 *)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);
 	sz += 2;
 	ie += 2;
 	/*capability info*/
 	*(u16 *)ie = 0;
-	*(u16 *)ie |= cpu_to_le16(cap_IBSS);
+	*(__le16 *)ie |= cpu_to_le16(cap_IBSS);
 	if (pregistrypriv->preamble == PREAMBLE_SHORT)
-		*(u16 *)ie |= cpu_to_le16(cap_ShortPremble);
+		*(__le16 *)ie |= cpu_to_le16(cap_ShortPremble);
 	if (pdev_network->Privacy)
-		*(u16 *)ie |= cpu_to_le16(cap_Privacy);
+		*(__le16 *)ie |= cpu_to_le16(cap_Privacy);
 	sz += 2;
 	ie += 2;
 	/*SSID*/
@@ -224,7 +224,7 @@ unsigned char *r8712_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
 				goto check_next_ie;
 			/*check version...*/
 			memcpy((u8 *)&val16, (pbuf + 6), sizeof(val16));
-			val16 = le16_to_cpu(val16);
+			le16_to_cpus(&val16);
 			if (val16 != 0x0001)
 				goto check_next_ie;
 			*wpa_ie_len = *(pbuf + 1);
@@ -304,7 +304,7 @@ int r8712_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher,
 	}
 	/*pairwise_cipher*/
 	if (left >= 2) {
-		count = le16_to_cpu(*(u16 *)pos);
+		count = le16_to_cpu(*(__le16 *)pos);
 		pos += 2;
 		left -= 2;
 		if (count == 0 || left < count * WPA_SELECTOR_LEN)
@@ -347,7 +347,7 @@ int r8712_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher,
 	}
 	/*pairwise_cipher*/
 	if (left >= 2) {
-		count = le16_to_cpu(*(u16 *)pos);
+		count = le16_to_cpu(*(__le16 *)pos);
 		pos += 2;
 		left -= 2;
 		if (count == 0 || left < count * RSN_SELECTOR_LEN)
-- 
2.7.4

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/13] staging: rtl8712: Fixed sparse warnings Jannik Becher <becher.jannik@gmail.com> - 2016-12-20 19:10 +0100
  [PATCH 01/13] staging: rtl8712: changed struct members to __le32 Jannik Becher <becher.jannik@gmail.com> - 2016-12-20 19:10 +0100
  [PATCH 12/13] staging: rtl8712: changed u16 to __be16 Jannik Becher <becher.jannik@gmail.com> - 2016-12-20 19:10 +0100
  [PATCH 11/13] staging: rtl8712: changed cast to __le16 Jannik Becher <becher.jannik@gmail.com> - 2016-12-20 19:10 +0100
  [PATCH 04/13] staging: rtl8712: casted variables to __le32 Jannik Becher <becher.jannik@gmail.com> - 2016-12-20 19:10 +0100
  [PATCH 10/13] staging: rtl8712: changed u32 to __le32 Jannik Becher <becher.jannik@gmail.com> - 2016-12-20 19:10 +0100
  [PATCH 13/13] staging: rtl8712: used a better macro Jannik Becher <becher.jannik@gmail.com> - 2016-12-20 19:10 +0100
  [PATCH 03/13] staging: rtl8712: changed function argument to __le32 Jannik Becher <becher.jannik@gmail.com> - 2016-12-20 19:10 +0100
  [PATCH 08/13] staging: rtl8712: changed uint to __le32 Jannik Becher <becher.jannik@gmail.com> - 2016-12-20 19:10 +0100
  [PATCH 09/13] staging: rtl8712: fixed little endian problem Jannik Becher <becher.jannik@gmail.com> - 2016-12-20 19:10 +0100
  [PATCH 05/13] staging: rtl8712: changed GetFrameSubType macro Jannik Becher <becher.jannik@gmail.com> - 2016-12-20 19:10 +0100
  [PATCH 02/13] staging: rtl8712: changed variables to __le32 Jannik Becher <becher.jannik@gmail.com> - 2016-12-20 19:10 +0100
  [PATCH 06/13] staging: rtl8712: changed typecast to __le Jannik Becher <becher.jannik@gmail.com> - 2016-12-20 19:10 +0100

csiph-web