aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtlwifi
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-06-04 08:44:17 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-06 12:31:33 -0400
commit2c208890c6d4e16076c6664137703ec813e8fa6c (patch)
treedd25049d7fdaf305679acc08f4b36fbcdbdb0213 /drivers/net/wireless/rtlwifi
parent6469933605a3ecdfa66b98160cde98ecd256cb3f (diff)
wireless: Remove casts to same type
Adding casts of objects to the same type is unnecessary and confusing for a human reader. For example, this cast: int y; int *p = (int *)&y; I used the coccinelle script below to find and remove these unnecessary casts. I manually removed the conversions this script produces of casts with __force, __iomem and __user. @@ type T; T *p; @@ - (T *)p + p Neatened the mwifiex_deauthenticate_infra function which was doing odd things with array pointers and not using is_zero_ether_addr. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/rtlwifi')
-rw-r--r--drivers/net/wireless/rtlwifi/base.c2
-rw-r--r--drivers/net/wireless/rtlwifi/cam.c2
-rw-r--r--drivers/net/wireless/rtlwifi/core.c14
-rw-r--r--drivers/net/wireless/rtlwifi/efuse.c4
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c14
-rw-r--r--drivers/net/wireless/rtlwifi/ps.c10
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c5
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c4
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/hw.c43
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/trx.c4
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/hw.c43
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/trx.c2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/dm.c2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/fw.c6
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/hw.c34
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/trx.c6
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/dm.c2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/hw.c46
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/trx.c2
19 files changed, 120 insertions, 125 deletions
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index f4c852c6749b..58e1f7bb4df1 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -907,7 +907,7 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
907 struct ieee80211_hdr *hdr = rtl_get_hdr(skb); 907 struct ieee80211_hdr *hdr = rtl_get_hdr(skb);
908 struct rtl_priv *rtlpriv = rtl_priv(hw); 908 struct rtl_priv *rtlpriv = rtl_priv(hw);
909 __le16 fc = hdr->frame_control; 909 __le16 fc = hdr->frame_control;
910 u8 *act = (u8 *) (((u8 *) skb->data + MAC80211_3ADDR_LEN)); 910 u8 *act = (u8 *)skb->data + MAC80211_3ADDR_LEN;
911 u8 category; 911 u8 category;
912 912
913 if (!ieee80211_is_action(fc)) 913 if (!ieee80211_is_action(fc))
diff --git a/drivers/net/wireless/rtlwifi/cam.c b/drivers/net/wireless/rtlwifi/cam.c
index 3d8cc4a0c86d..2d1a8220d5c0 100644
--- a/drivers/net/wireless/rtlwifi/cam.c
+++ b/drivers/net/wireless/rtlwifi/cam.c
@@ -146,7 +146,7 @@ u8 rtl_cam_add_one_entry(struct ieee80211_hw *hw, u8 *mac_addr,
146 } 146 }
147 147
148 rtl_cam_program_entry(hw, ul_entry_idx, mac_addr, 148 rtl_cam_program_entry(hw, ul_entry_idx, mac_addr,
149 (u8 *) key_content, us_config); 149 key_content, us_config);
150 150
151 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "<===\n"); 151 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "<===\n");
152 152
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c
index 278e9f957e0d..a18ad2a98938 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -680,7 +680,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
680 680
681 mac->short_preamble = bss_conf->use_short_preamble; 681 mac->short_preamble = bss_conf->use_short_preamble;
682 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ACK_PREAMBLE, 682 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ACK_PREAMBLE,
683 (u8 *) (&mac->short_preamble)); 683 &mac->short_preamble);
684 } 684 }
685 685
686 if (changed & BSS_CHANGED_ERP_SLOT) { 686 if (changed & BSS_CHANGED_ERP_SLOT) {
@@ -693,7 +693,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
693 mac->slot_time = RTL_SLOT_TIME_20; 693 mac->slot_time = RTL_SLOT_TIME_20;
694 694
695 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME, 695 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME,
696 (u8 *) (&mac->slot_time)); 696 &mac->slot_time);
697 } 697 }
698 698
699 if (changed & BSS_CHANGED_HT) { 699 if (changed & BSS_CHANGED_HT) {
@@ -713,7 +713,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
713 rcu_read_unlock(); 713 rcu_read_unlock();
714 714
715 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SHORTGI_DENSITY, 715 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SHORTGI_DENSITY,
716 (u8 *) (&mac->max_mss_density)); 716 &mac->max_mss_density);
717 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AMPDU_FACTOR, 717 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AMPDU_FACTOR,
718 &mac->current_ampdu_factor); 718 &mac->current_ampdu_factor);
719 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AMPDU_MIN_SPACE, 719 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AMPDU_MIN_SPACE,
@@ -801,7 +801,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
801 u8 mstatus = RT_MEDIA_CONNECT; 801 u8 mstatus = RT_MEDIA_CONNECT;
802 rtlpriv->cfg->ops->set_hw_reg(hw, 802 rtlpriv->cfg->ops->set_hw_reg(hw,
803 HW_VAR_H2C_FW_JOINBSSRPT, 803 HW_VAR_H2C_FW_JOINBSSRPT,
804 (u8 *) (&mstatus)); 804 &mstatus);
805 ppsc->report_linked = true; 805 ppsc->report_linked = true;
806 } 806 }
807 } else { 807 } else {
@@ -809,7 +809,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
809 u8 mstatus = RT_MEDIA_DISCONNECT; 809 u8 mstatus = RT_MEDIA_DISCONNECT;
810 rtlpriv->cfg->ops->set_hw_reg(hw, 810 rtlpriv->cfg->ops->set_hw_reg(hw,
811 HW_VAR_H2C_FW_JOINBSSRPT, 811 HW_VAR_H2C_FW_JOINBSSRPT,
812 (u8 *)(&mstatus)); 812 &mstatus);
813 ppsc->report_linked = false; 813 ppsc->report_linked = false;
814 } 814 }
815 } 815 }
@@ -836,7 +836,7 @@ static void rtl_op_set_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
836 u8 bibss = (mac->opmode == NL80211_IFTYPE_ADHOC) ? 1 : 0; 836 u8 bibss = (mac->opmode == NL80211_IFTYPE_ADHOC) ? 1 : 0;
837 837
838 mac->tsf = tsf; 838 mac->tsf = tsf;
839 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_CORRECT_TSF, (u8 *) (&bibss)); 839 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_CORRECT_TSF, &bibss);
840} 840}
841 841
842static void rtl_op_reset_tsf(struct ieee80211_hw *hw, 842static void rtl_op_reset_tsf(struct ieee80211_hw *hw,
@@ -845,7 +845,7 @@ static void rtl_op_reset_tsf(struct ieee80211_hw *hw,
845 struct rtl_priv *rtlpriv = rtl_priv(hw); 845 struct rtl_priv *rtlpriv = rtl_priv(hw);
846 u8 tmp = 0; 846 u8 tmp = 0;
847 847
848 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_DUAL_TSF_RST, (u8 *) (&tmp)); 848 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_DUAL_TSF_RST, &tmp);
849} 849}
850 850
851static void rtl_op_sta_notify(struct ieee80211_hw *hw, 851static void rtl_op_sta_notify(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c
index 1f143800a8d7..8e2f9afb125a 100644
--- a/drivers/net/wireless/rtlwifi/efuse.c
+++ b/drivers/net/wireless/rtlwifi/efuse.c
@@ -352,7 +352,7 @@ void read_efuse(struct ieee80211_hw *hw, u16 _offset, u16 _size_byte, u8 *pbuf)
352 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_EFUSE_BYTES, 352 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_EFUSE_BYTES,
353 (u8 *)&efuse_utilized); 353 (u8 *)&efuse_utilized);
354 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_EFUSE_USAGE, 354 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_EFUSE_USAGE,
355 (u8 *)&efuse_usage); 355 &efuse_usage);
356done: 356done:
357 for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) 357 for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++)
358 kfree(efuse_word[i]); 358 kfree(efuse_word[i]);
@@ -409,7 +409,7 @@ void efuse_shadow_read(struct ieee80211_hw *hw, u8 type,
409 else if (type == 2) 409 else if (type == 2)
410 efuse_shadow_read_2byte(hw, offset, (u16 *) value); 410 efuse_shadow_read_2byte(hw, offset, (u16 *) value);
411 else if (type == 4) 411 else if (type == 4)
412 efuse_shadow_read_4byte(hw, offset, (u32 *) value); 412 efuse_shadow_read_4byte(hw, offset, value);
413 413
414} 414}
415 415
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 2062ea1d7c80..82d3afcfecd1 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -756,10 +756,10 @@ done:
756 if (index == rtlpci->rxringcount - 1) 756 if (index == rtlpci->rxringcount - 1)
757 rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false, 757 rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false,
758 HW_DESC_RXERO, 758 HW_DESC_RXERO,
759 (u8 *)&tmp_one); 759 &tmp_one);
760 760
761 rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false, HW_DESC_RXOWN, 761 rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false, HW_DESC_RXOWN,
762 (u8 *)&tmp_one); 762 &tmp_one);
763 763
764 index = (index + 1) % rtlpci->rxringcount; 764 index = (index + 1) % rtlpci->rxringcount;
765 } 765 }
@@ -934,7 +934,7 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw)
934 __skb_queue_tail(&ring->queue, pskb); 934 __skb_queue_tail(&ring->queue, pskb);
935 935
936 rtlpriv->cfg->ops->set_desc((u8 *) pdesc, true, HW_DESC_OWN, 936 rtlpriv->cfg->ops->set_desc((u8 *) pdesc, true, HW_DESC_OWN,
937 (u8 *)&temp_one); 937 &temp_one);
938 938
939 return; 939 return;
940} 940}
@@ -1126,11 +1126,11 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw)
1126 rxbuffersize); 1126 rxbuffersize);
1127 rtlpriv->cfg->ops->set_desc((u8 *) entry, false, 1127 rtlpriv->cfg->ops->set_desc((u8 *) entry, false,
1128 HW_DESC_RXOWN, 1128 HW_DESC_RXOWN,
1129 (u8 *)&tmp_one); 1129 &tmp_one);
1130 } 1130 }
1131 1131
1132 rtlpriv->cfg->ops->set_desc((u8 *) entry, false, 1132 rtlpriv->cfg->ops->set_desc((u8 *) entry, false,
1133 HW_DESC_RXERO, (u8 *)&tmp_one); 1133 HW_DESC_RXERO, &tmp_one);
1134 } 1134 }
1135 return 0; 1135 return 0;
1136} 1136}
@@ -1263,7 +1263,7 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw)
1263 rtlpriv->cfg->ops->set_desc((u8 *) entry, 1263 rtlpriv->cfg->ops->set_desc((u8 *) entry,
1264 false, 1264 false,
1265 HW_DESC_RXOWN, 1265 HW_DESC_RXOWN,
1266 (u8 *)&tmp_one); 1266 &tmp_one);
1267 } 1267 }
1268 rtlpci->rx_ring[rx_queue_idx].idx = 0; 1268 rtlpci->rx_ring[rx_queue_idx].idx = 0;
1269 } 1269 }
@@ -1422,7 +1422,7 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
1422 __skb_queue_tail(&ring->queue, skb); 1422 __skb_queue_tail(&ring->queue, skb);
1423 1423
1424 rtlpriv->cfg->ops->set_desc((u8 *)pdesc, true, 1424 rtlpriv->cfg->ops->set_desc((u8 *)pdesc, true,
1425 HW_DESC_OWN, (u8 *)&temp_one); 1425 HW_DESC_OWN, &temp_one);
1426 1426
1427 1427
1428 if ((ring->entries - skb_queue_len(&ring->queue)) < 2 && 1428 if ((ring->entries - skb_queue_len(&ring->queue)) < 2 &&
diff --git a/drivers/net/wireless/rtlwifi/ps.c b/drivers/net/wireless/rtlwifi/ps.c
index 5ae26647f340..13ad33e85577 100644
--- a/drivers/net/wireless/rtlwifi/ps.c
+++ b/drivers/net/wireless/rtlwifi/ps.c
@@ -333,10 +333,10 @@ static void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode)
333 rpwm_val = 0x0C; /* RF on */ 333 rpwm_val = 0x0C; /* RF on */
334 fw_pwrmode = FW_PS_ACTIVE_MODE; 334 fw_pwrmode = FW_PS_ACTIVE_MODE;
335 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SET_RPWM, 335 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SET_RPWM,
336 (u8 *) (&rpwm_val)); 336 &rpwm_val);
337 rtlpriv->cfg->ops->set_hw_reg(hw, 337 rtlpriv->cfg->ops->set_hw_reg(hw,
338 HW_VAR_H2C_FW_PWRMODE, 338 HW_VAR_H2C_FW_PWRMODE,
339 (u8 *) (&fw_pwrmode)); 339 &fw_pwrmode);
340 fw_current_inps = false; 340 fw_current_inps = false;
341 341
342 rtlpriv->cfg->ops->set_hw_reg(hw, 342 rtlpriv->cfg->ops->set_hw_reg(hw,
@@ -356,11 +356,11 @@ static void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode)
356 (u8 *) (&fw_current_inps)); 356 (u8 *) (&fw_current_inps));
357 rtlpriv->cfg->ops->set_hw_reg(hw, 357 rtlpriv->cfg->ops->set_hw_reg(hw,
358 HW_VAR_H2C_FW_PWRMODE, 358 HW_VAR_H2C_FW_PWRMODE,
359 (u8 *) (&ppsc->fwctrl_psmode)); 359 &ppsc->fwctrl_psmode);
360 360
361 rtlpriv->cfg->ops->set_hw_reg(hw, 361 rtlpriv->cfg->ops->set_hw_reg(hw,
362 HW_VAR_SET_RPWM, 362 HW_VAR_SET_RPWM,
363 (u8 *) (&rpwm_val)); 363 &rpwm_val);
364 } else { 364 } else {
365 /* Reset the power save related parameters. */ 365 /* Reset the power save related parameters. */
366 ppsc->dot11_psmode = EACTIVE; 366 ppsc->dot11_psmode = EACTIVE;
@@ -446,7 +446,7 @@ void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len)
446{ 446{
447 struct rtl_priv *rtlpriv = rtl_priv(hw); 447 struct rtl_priv *rtlpriv = rtl_priv(hw);
448 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 448 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
449 struct ieee80211_hdr *hdr = (void *) data; 449 struct ieee80211_hdr *hdr = data;
450 struct ieee80211_tim_ie *tim_ie; 450 struct ieee80211_tim_ie *tim_ie;
451 u8 *tim; 451 u8 *tim;
452 u8 tim_len; 452 u8 tim_len;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
index f7f48c7ac854..a45afda8259c 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
@@ -656,9 +656,8 @@ static void rtl92c_dm_check_edca_turbo(struct ieee80211_hw *hw)
656 } else { 656 } else {
657 if (rtlpriv->dm.current_turbo_edca) { 657 if (rtlpriv->dm.current_turbo_edca) {
658 u8 tmp = AC0_BE; 658 u8 tmp = AC0_BE;
659 rtlpriv->cfg->ops->set_hw_reg(hw, 659 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AC_PARAM,
660 HW_VAR_AC_PARAM, 660 &tmp);
661 (u8 *) (&tmp));
662 rtlpriv->dm.current_turbo_edca = false; 661 rtlpriv->dm.current_turbo_edca = false;
663 } 662 }
664 } 663 }
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
index 692c8ef5ee89..44febfde9493 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
@@ -168,7 +168,7 @@ static void _rtl92c_write_fw(struct ieee80211_hw *hw,
168{ 168{
169 struct rtl_priv *rtlpriv = rtl_priv(hw); 169 struct rtl_priv *rtlpriv = rtl_priv(hw);
170 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 170 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
171 u8 *bufferPtr = (u8 *) buffer; 171 u8 *bufferPtr = buffer;
172 172
173 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, "FW size is %d bytes\n", size); 173 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, "FW size is %d bytes\n", size);
174 174
@@ -262,7 +262,7 @@ int rtl92c_download_fw(struct ieee80211_hw *hw)
262 return 1; 262 return 1;
263 263
264 pfwheader = (struct rtl92c_firmware_header *)rtlhal->pfirmware; 264 pfwheader = (struct rtl92c_firmware_header *)rtlhal->pfirmware;
265 pfwdata = (u8 *) rtlhal->pfirmware; 265 pfwdata = rtlhal->pfirmware;
266 fwsize = rtlhal->fwsize; 266 fwsize = rtlhal->fwsize;
267 267
268 if (IS_FW_HEADER_EXIST(pfwheader)) { 268 if (IS_FW_HEADER_EXIST(pfwheader)) {
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
index 5c4d9bc040f1..bd0da7ef290b 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
@@ -214,13 +214,13 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
214 for (e_aci = 0; e_aci < AC_MAX; e_aci++) { 214 for (e_aci = 0; e_aci < AC_MAX; e_aci++) {
215 rtlpriv->cfg->ops->set_hw_reg(hw, 215 rtlpriv->cfg->ops->set_hw_reg(hw,
216 HW_VAR_AC_PARAM, 216 HW_VAR_AC_PARAM,
217 (u8 *) (&e_aci)); 217 &e_aci);
218 } 218 }
219 break; 219 break;
220 } 220 }
221 case HW_VAR_ACK_PREAMBLE:{ 221 case HW_VAR_ACK_PREAMBLE:{
222 u8 reg_tmp; 222 u8 reg_tmp;
223 u8 short_preamble = (bool) (*(u8 *) val); 223 u8 short_preamble = (bool)*val;
224 reg_tmp = (mac->cur_40_prime_sc) << 5; 224 reg_tmp = (mac->cur_40_prime_sc) << 5;
225 if (short_preamble) 225 if (short_preamble)
226 reg_tmp |= 0x80; 226 reg_tmp |= 0x80;
@@ -232,7 +232,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
232 u8 min_spacing_to_set; 232 u8 min_spacing_to_set;
233 u8 sec_min_space; 233 u8 sec_min_space;
234 234
235 min_spacing_to_set = *((u8 *) val); 235 min_spacing_to_set = *val;
236 if (min_spacing_to_set <= 7) { 236 if (min_spacing_to_set <= 7) {
237 sec_min_space = 0; 237 sec_min_space = 0;
238 238
@@ -257,7 +257,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
257 case HW_VAR_SHORTGI_DENSITY:{ 257 case HW_VAR_SHORTGI_DENSITY:{
258 u8 density_to_set; 258 u8 density_to_set;
259 259
260 density_to_set = *((u8 *) val); 260 density_to_set = *val;
261 mac->min_space_cfg |= (density_to_set << 3); 261 mac->min_space_cfg |= (density_to_set << 3);
262 262
263 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 263 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
@@ -284,7 +284,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
284 else 284 else
285 p_regtoset = regtoset_normal; 285 p_regtoset = regtoset_normal;
286 286
287 factor_toset = *((u8 *) val); 287 factor_toset = *(val);
288 if (factor_toset <= 3) { 288 if (factor_toset <= 3) {
289 factor_toset = (1 << (factor_toset + 2)); 289 factor_toset = (1 << (factor_toset + 2));
290 if (factor_toset > 0xf) 290 if (factor_toset > 0xf)
@@ -316,17 +316,17 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
316 break; 316 break;
317 } 317 }
318 case HW_VAR_AC_PARAM:{ 318 case HW_VAR_AC_PARAM:{
319 u8 e_aci = *((u8 *) val); 319 u8 e_aci = *(val);
320 rtl92c_dm_init_edca_turbo(hw); 320 rtl92c_dm_init_edca_turbo(hw);
321 321
322 if (rtlpci->acm_method != eAcmWay2_SW) 322 if (rtlpci->acm_method != eAcmWay2_SW)
323 rtlpriv->cfg->ops->set_hw_reg(hw, 323 rtlpriv->cfg->ops->set_hw_reg(hw,
324 HW_VAR_ACM_CTRL, 324 HW_VAR_ACM_CTRL,
325 (u8 *) (&e_aci)); 325 (&e_aci));
326 break; 326 break;
327 } 327 }
328 case HW_VAR_ACM_CTRL:{ 328 case HW_VAR_ACM_CTRL:{
329 u8 e_aci = *((u8 *) val); 329 u8 e_aci = *(val);
330 union aci_aifsn *p_aci_aifsn = 330 union aci_aifsn *p_aci_aifsn =
331 (union aci_aifsn *)(&(mac->ac[0].aifs)); 331 (union aci_aifsn *)(&(mac->ac[0].aifs));
332 u8 acm = p_aci_aifsn->f.acm; 332 u8 acm = p_aci_aifsn->f.acm;
@@ -382,7 +382,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
382 break; 382 break;
383 } 383 }
384 case HW_VAR_RETRY_LIMIT:{ 384 case HW_VAR_RETRY_LIMIT:{
385 u8 retry_limit = ((u8 *) (val))[0]; 385 u8 retry_limit = val[0];
386 386
387 rtl_write_word(rtlpriv, REG_RL, 387 rtl_write_word(rtlpriv, REG_RL,
388 retry_limit << RETRY_LIMIT_SHORT_SHIFT | 388 retry_limit << RETRY_LIMIT_SHORT_SHIFT |
@@ -396,13 +396,13 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
396 rtlefuse->efuse_usedbytes = *((u16 *) val); 396 rtlefuse->efuse_usedbytes = *((u16 *) val);
397 break; 397 break;
398 case HW_VAR_EFUSE_USAGE: 398 case HW_VAR_EFUSE_USAGE:
399 rtlefuse->efuse_usedpercentage = *((u8 *) val); 399 rtlefuse->efuse_usedpercentage = *val;
400 break; 400 break;
401 case HW_VAR_IO_CMD: 401 case HW_VAR_IO_CMD:
402 rtl92c_phy_set_io_cmd(hw, (*(enum io_type *)val)); 402 rtl92c_phy_set_io_cmd(hw, (*(enum io_type *)val));
403 break; 403 break;
404 case HW_VAR_WPA_CONFIG: 404 case HW_VAR_WPA_CONFIG:
405 rtl_write_byte(rtlpriv, REG_SECCFG, *((u8 *) val)); 405 rtl_write_byte(rtlpriv, REG_SECCFG, *val);
406 break; 406 break;
407 case HW_VAR_SET_RPWM:{ 407 case HW_VAR_SET_RPWM:{
408 u8 rpwm_val; 408 u8 rpwm_val;
@@ -411,31 +411,30 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
411 udelay(1); 411 udelay(1);
412 412
413 if (rpwm_val & BIT(7)) { 413 if (rpwm_val & BIT(7)) {
414 rtl_write_byte(rtlpriv, REG_PCIE_HRPWM, 414 rtl_write_byte(rtlpriv, REG_PCIE_HRPWM, *val);
415 (*(u8 *) val));
416 } else { 415 } else {
417 rtl_write_byte(rtlpriv, REG_PCIE_HRPWM, 416 rtl_write_byte(rtlpriv, REG_PCIE_HRPWM,
418 ((*(u8 *) val) | BIT(7))); 417 *val | BIT(7));
419 } 418 }
420 419
421 break; 420 break;
422 } 421 }
423 case HW_VAR_H2C_FW_PWRMODE:{ 422 case HW_VAR_H2C_FW_PWRMODE:{
424 u8 psmode = (*(u8 *) val); 423 u8 psmode = *val;
425 424
426 if ((psmode != FW_PS_ACTIVE_MODE) && 425 if ((psmode != FW_PS_ACTIVE_MODE) &&
427 (!IS_92C_SERIAL(rtlhal->version))) { 426 (!IS_92C_SERIAL(rtlhal->version))) {
428 rtl92c_dm_rf_saving(hw, true); 427 rtl92c_dm_rf_saving(hw, true);
429 } 428 }
430 429
431 rtl92c_set_fw_pwrmode_cmd(hw, (*(u8 *) val)); 430 rtl92c_set_fw_pwrmode_cmd(hw, *val);
432 break; 431 break;
433 } 432 }
434 case HW_VAR_FW_PSMODE_STATUS: 433 case HW_VAR_FW_PSMODE_STATUS:
435 ppsc->fw_current_inpsmode = *((bool *) val); 434 ppsc->fw_current_inpsmode = *((bool *) val);
436 break; 435 break;
437 case HW_VAR_H2C_FW_JOINBSSRPT:{ 436 case HW_VAR_H2C_FW_JOINBSSRPT:{
438 u8 mstatus = (*(u8 *) val); 437 u8 mstatus = *val;
439 u8 tmp_regcr, tmp_reg422; 438 u8 tmp_regcr, tmp_reg422;
440 bool recover = false; 439 bool recover = false;
441 440
@@ -472,7 +471,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
472 rtl_write_byte(rtlpriv, REG_CR + 1, 471 rtl_write_byte(rtlpriv, REG_CR + 1,
473 (tmp_regcr & ~(BIT(0)))); 472 (tmp_regcr & ~(BIT(0))));
474 } 473 }
475 rtl92c_set_fw_joinbss_report_cmd(hw, (*(u8 *) val)); 474 rtl92c_set_fw_joinbss_report_cmd(hw, *val);
476 475
477 break; 476 break;
478 } 477 }
@@ -486,7 +485,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
486 break; 485 break;
487 } 486 }
488 case HW_VAR_CORRECT_TSF:{ 487 case HW_VAR_CORRECT_TSF:{
489 u8 btype_ibss = ((u8 *) (val))[0]; 488 u8 btype_ibss = val[0];
490 489
491 if (btype_ibss) 490 if (btype_ibss)
492 _rtl92ce_stop_tx_beacon(hw); 491 _rtl92ce_stop_tx_beacon(hw);
@@ -1589,10 +1588,10 @@ static void _rtl92ce_read_adapter_info(struct ieee80211_hw *hw)
1589 rtlefuse->autoload_failflag, 1588 rtlefuse->autoload_failflag,
1590 hwinfo); 1589 hwinfo);
1591 1590
1592 rtlefuse->eeprom_channelplan = *(u8 *)&hwinfo[EEPROM_CHANNELPLAN]; 1591 rtlefuse->eeprom_channelplan = *&hwinfo[EEPROM_CHANNELPLAN];
1593 rtlefuse->eeprom_version = *(u16 *)&hwinfo[EEPROM_VERSION]; 1592 rtlefuse->eeprom_version = *(u16 *)&hwinfo[EEPROM_VERSION];
1594 rtlefuse->txpwr_fromeprom = true; 1593 rtlefuse->txpwr_fromeprom = true;
1595 rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMER_ID]; 1594 rtlefuse->eeprom_oemid = *&hwinfo[EEPROM_CUSTOMER_ID];
1596 1595
1597 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1596 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1598 "EEPROM Customer ID: 0x%2x\n", rtlefuse->eeprom_oemid); 1597 "EEPROM Customer ID: 0x%2x\n", rtlefuse->eeprom_oemid);
@@ -1939,7 +1938,7 @@ void rtl92ce_update_channel_access_setting(struct ieee80211_hw *hw)
1939 u16 sifs_timer; 1938 u16 sifs_timer;
1940 1939
1941 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME, 1940 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME,
1942 (u8 *)&mac->slot_time); 1941 &mac->slot_time);
1943 if (!mac->ht_enable) 1942 if (!mac->ht_enable)
1944 sifs_timer = 0x0a0a; 1943 sifs_timer = 0x0a0a;
1945 else 1944 else
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
index 3af874e69595..52166640f167 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
@@ -605,7 +605,7 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
605 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); 605 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
606 bool defaultadapter = true; 606 bool defaultadapter = true;
607 struct ieee80211_sta *sta; 607 struct ieee80211_sta *sta;
608 u8 *pdesc = (u8 *) pdesc_tx; 608 u8 *pdesc = pdesc_tx;
609 u16 seq_number; 609 u16 seq_number;
610 __le16 fc = hdr->frame_control; 610 __le16 fc = hdr->frame_control;
611 u8 fw_qsel = _rtl92ce_map_hwqueue_to_fwqueue(skb, hw_queue); 611 u8 fw_qsel = _rtl92ce_map_hwqueue_to_fwqueue(skb, hw_queue);
@@ -806,7 +806,7 @@ void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw,
806 806
807 SET_TX_DESC_OWN(pdesc, 1); 807 SET_TX_DESC_OWN(pdesc, 1);
808 808
809 SET_TX_DESC_PKT_SIZE((u8 *) pdesc, (u16) (skb->len)); 809 SET_TX_DESC_PKT_SIZE(pdesc, (u16) (skb->len));
810 810
811 SET_TX_DESC_FIRST_SEG(pdesc, 1); 811 SET_TX_DESC_FIRST_SEG(pdesc, 1);
812 SET_TX_DESC_LAST_SEG(pdesc, 1); 812 SET_TX_DESC_LAST_SEG(pdesc, 1);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
index 0c74d4f2eeb4..4bbb711a36c5 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
@@ -381,11 +381,11 @@ static void _rtl92cu_read_adapter_info(struct ieee80211_hw *hw)
381 rtlefuse->eeprom_did = le16_to_cpu(*(__le16 *)&hwinfo[EEPROM_DID]); 381 rtlefuse->eeprom_did = le16_to_cpu(*(__le16 *)&hwinfo[EEPROM_DID]);
382 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, " VID = 0x%02x PID = 0x%02x\n", 382 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, " VID = 0x%02x PID = 0x%02x\n",
383 rtlefuse->eeprom_vid, rtlefuse->eeprom_did); 383 rtlefuse->eeprom_vid, rtlefuse->eeprom_did);
384 rtlefuse->eeprom_channelplan = *(u8 *)&hwinfo[EEPROM_CHANNELPLAN]; 384 rtlefuse->eeprom_channelplan = hwinfo[EEPROM_CHANNELPLAN];
385 rtlefuse->eeprom_version = 385 rtlefuse->eeprom_version =
386 le16_to_cpu(*(__le16 *)&hwinfo[EEPROM_VERSION]); 386 le16_to_cpu(*(__le16 *)&hwinfo[EEPROM_VERSION]);
387 rtlefuse->txpwr_fromeprom = true; 387 rtlefuse->txpwr_fromeprom = true;
388 rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMER_ID]; 388 rtlefuse->eeprom_oemid = hwinfo[EEPROM_CUSTOMER_ID];
389 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "EEPROM Customer ID: 0x%2x\n", 389 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "EEPROM Customer ID: 0x%2x\n",
390 rtlefuse->eeprom_oemid); 390 rtlefuse->eeprom_oemid);
391 if (rtlhal->oem_id == RT_CID_DEFAULT) { 391 if (rtlhal->oem_id == RT_CID_DEFAULT) {
@@ -1660,7 +1660,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1660 for (e_aci = 0; e_aci < AC_MAX; e_aci++) 1660 for (e_aci = 0; e_aci < AC_MAX; e_aci++)
1661 rtlpriv->cfg->ops->set_hw_reg(hw, 1661 rtlpriv->cfg->ops->set_hw_reg(hw,
1662 HW_VAR_AC_PARAM, 1662 HW_VAR_AC_PARAM,
1663 (u8 *)(&e_aci)); 1663 &e_aci);
1664 } else { 1664 } else {
1665 u8 sifstime = 0; 1665 u8 sifstime = 0;
1666 u8 u1bAIFS; 1666 u8 u1bAIFS;
@@ -1685,7 +1685,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1685 } 1685 }
1686 case HW_VAR_ACK_PREAMBLE:{ 1686 case HW_VAR_ACK_PREAMBLE:{
1687 u8 reg_tmp; 1687 u8 reg_tmp;
1688 u8 short_preamble = (bool) (*(u8 *) val); 1688 u8 short_preamble = (bool)*val;
1689 reg_tmp = 0; 1689 reg_tmp = 0;
1690 if (short_preamble) 1690 if (short_preamble)
1691 reg_tmp |= 0x80; 1691 reg_tmp |= 0x80;
@@ -1696,7 +1696,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1696 u8 min_spacing_to_set; 1696 u8 min_spacing_to_set;
1697 u8 sec_min_space; 1697 u8 sec_min_space;
1698 1698
1699 min_spacing_to_set = *((u8 *) val); 1699 min_spacing_to_set = *val;
1700 if (min_spacing_to_set <= 7) { 1700 if (min_spacing_to_set <= 7) {
1701 switch (rtlpriv->sec.pairwise_enc_algorithm) { 1701 switch (rtlpriv->sec.pairwise_enc_algorithm) {
1702 case NO_ENCRYPTION: 1702 case NO_ENCRYPTION:
@@ -1729,7 +1729,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1729 case HW_VAR_SHORTGI_DENSITY:{ 1729 case HW_VAR_SHORTGI_DENSITY:{
1730 u8 density_to_set; 1730 u8 density_to_set;
1731 1731
1732 density_to_set = *((u8 *) val); 1732 density_to_set = *val;
1733 density_to_set &= 0x1f; 1733 density_to_set &= 0x1f;
1734 mac->min_space_cfg &= 0x07; 1734 mac->min_space_cfg &= 0x07;
1735 mac->min_space_cfg |= (density_to_set << 3); 1735 mac->min_space_cfg |= (density_to_set << 3);
@@ -1747,7 +1747,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1747 u8 index = 0; 1747 u8 index = 0;
1748 1748
1749 p_regtoset = regtoset_normal; 1749 p_regtoset = regtoset_normal;
1750 factor_toset = *((u8 *) val); 1750 factor_toset = *val;
1751 if (factor_toset <= 3) { 1751 if (factor_toset <= 3) {
1752 factor_toset = (1 << (factor_toset + 2)); 1752 factor_toset = (1 << (factor_toset + 2));
1753 if (factor_toset > 0xf) 1753 if (factor_toset > 0xf)
@@ -1774,7 +1774,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1774 break; 1774 break;
1775 } 1775 }
1776 case HW_VAR_AC_PARAM:{ 1776 case HW_VAR_AC_PARAM:{
1777 u8 e_aci = *((u8 *) val); 1777 u8 e_aci = *val;
1778 u32 u4b_ac_param; 1778 u32 u4b_ac_param;
1779 u16 cw_min = le16_to_cpu(mac->ac[e_aci].cw_min); 1779 u16 cw_min = le16_to_cpu(mac->ac[e_aci].cw_min);
1780 u16 cw_max = le16_to_cpu(mac->ac[e_aci].cw_max); 1780 u16 cw_max = le16_to_cpu(mac->ac[e_aci].cw_max);
@@ -1814,11 +1814,11 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1814 } 1814 }
1815 if (rtlusb->acm_method != eAcmWay2_SW) 1815 if (rtlusb->acm_method != eAcmWay2_SW)
1816 rtlpriv->cfg->ops->set_hw_reg(hw, 1816 rtlpriv->cfg->ops->set_hw_reg(hw,
1817 HW_VAR_ACM_CTRL, (u8 *)(&e_aci)); 1817 HW_VAR_ACM_CTRL, &e_aci);
1818 break; 1818 break;
1819 } 1819 }
1820 case HW_VAR_ACM_CTRL:{ 1820 case HW_VAR_ACM_CTRL:{
1821 u8 e_aci = *((u8 *) val); 1821 u8 e_aci = *val;
1822 union aci_aifsn *p_aci_aifsn = (union aci_aifsn *) 1822 union aci_aifsn *p_aci_aifsn = (union aci_aifsn *)
1823 (&(mac->ac[0].aifs)); 1823 (&(mac->ac[0].aifs));
1824 u8 acm = p_aci_aifsn->f.acm; 1824 u8 acm = p_aci_aifsn->f.acm;
@@ -1874,7 +1874,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1874 break; 1874 break;
1875 } 1875 }
1876 case HW_VAR_RETRY_LIMIT:{ 1876 case HW_VAR_RETRY_LIMIT:{
1877 u8 retry_limit = ((u8 *) (val))[0]; 1877 u8 retry_limit = val[0];
1878 1878
1879 rtl_write_word(rtlpriv, REG_RL, 1879 rtl_write_word(rtlpriv, REG_RL,
1880 retry_limit << RETRY_LIMIT_SHORT_SHIFT | 1880 retry_limit << RETRY_LIMIT_SHORT_SHIFT |
@@ -1891,39 +1891,38 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1891 rtlefuse->efuse_usedbytes = *((u16 *) val); 1891 rtlefuse->efuse_usedbytes = *((u16 *) val);
1892 break; 1892 break;
1893 case HW_VAR_EFUSE_USAGE: 1893 case HW_VAR_EFUSE_USAGE:
1894 rtlefuse->efuse_usedpercentage = *((u8 *) val); 1894 rtlefuse->efuse_usedpercentage = *val;
1895 break; 1895 break;
1896 case HW_VAR_IO_CMD: 1896 case HW_VAR_IO_CMD:
1897 rtl92c_phy_set_io_cmd(hw, (*(enum io_type *)val)); 1897 rtl92c_phy_set_io_cmd(hw, (*(enum io_type *)val));
1898 break; 1898 break;
1899 case HW_VAR_WPA_CONFIG: 1899 case HW_VAR_WPA_CONFIG:
1900 rtl_write_byte(rtlpriv, REG_SECCFG, *((u8 *) val)); 1900 rtl_write_byte(rtlpriv, REG_SECCFG, *val);
1901 break; 1901 break;
1902 case HW_VAR_SET_RPWM:{ 1902 case HW_VAR_SET_RPWM:{
1903 u8 rpwm_val = rtl_read_byte(rtlpriv, REG_USB_HRPWM); 1903 u8 rpwm_val = rtl_read_byte(rtlpriv, REG_USB_HRPWM);
1904 1904
1905 if (rpwm_val & BIT(7)) 1905 if (rpwm_val & BIT(7))
1906 rtl_write_byte(rtlpriv, REG_USB_HRPWM, 1906 rtl_write_byte(rtlpriv, REG_USB_HRPWM, *val);
1907 (*(u8 *)val));
1908 else 1907 else
1909 rtl_write_byte(rtlpriv, REG_USB_HRPWM, 1908 rtl_write_byte(rtlpriv, REG_USB_HRPWM,
1910 ((*(u8 *)val) | BIT(7))); 1909 *val | BIT(7));
1911 break; 1910 break;
1912 } 1911 }
1913 case HW_VAR_H2C_FW_PWRMODE:{ 1912 case HW_VAR_H2C_FW_PWRMODE:{
1914 u8 psmode = (*(u8 *) val); 1913 u8 psmode = *val;
1915 1914
1916 if ((psmode != FW_PS_ACTIVE_MODE) && 1915 if ((psmode != FW_PS_ACTIVE_MODE) &&
1917 (!IS_92C_SERIAL(rtlhal->version))) 1916 (!IS_92C_SERIAL(rtlhal->version)))
1918 rtl92c_dm_rf_saving(hw, true); 1917 rtl92c_dm_rf_saving(hw, true);
1919 rtl92c_set_fw_pwrmode_cmd(hw, (*(u8 *) val)); 1918 rtl92c_set_fw_pwrmode_cmd(hw, (*val));
1920 break; 1919 break;
1921 } 1920 }
1922 case HW_VAR_FW_PSMODE_STATUS: 1921 case HW_VAR_FW_PSMODE_STATUS:
1923 ppsc->fw_current_inpsmode = *((bool *) val); 1922 ppsc->fw_current_inpsmode = *((bool *) val);
1924 break; 1923 break;
1925 case HW_VAR_H2C_FW_JOINBSSRPT:{ 1924 case HW_VAR_H2C_FW_JOINBSSRPT:{
1926 u8 mstatus = (*(u8 *) val); 1925 u8 mstatus = *val;
1927 u8 tmp_reg422; 1926 u8 tmp_reg422;
1928 bool recover = false; 1927 bool recover = false;
1929 1928
@@ -1948,7 +1947,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1948 tmp_reg422 | BIT(6)); 1947 tmp_reg422 | BIT(6));
1949 rtl_write_byte(rtlpriv, REG_CR + 1, 0x02); 1948 rtl_write_byte(rtlpriv, REG_CR + 1, 0x02);
1950 } 1949 }
1951 rtl92c_set_fw_joinbss_report_cmd(hw, (*(u8 *) val)); 1950 rtl92c_set_fw_joinbss_report_cmd(hw, (*val));
1952 break; 1951 break;
1953 } 1952 }
1954 case HW_VAR_AID:{ 1953 case HW_VAR_AID:{
@@ -1961,7 +1960,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1961 break; 1960 break;
1962 } 1961 }
1963 case HW_VAR_CORRECT_TSF:{ 1962 case HW_VAR_CORRECT_TSF:{
1964 u8 btype_ibss = ((u8 *) (val))[0]; 1963 u8 btype_ibss = val[0];
1965 1964
1966 if (btype_ibss) 1965 if (btype_ibss)
1967 _rtl92cu_stop_tx_beacon(hw); 1966 _rtl92cu_stop_tx_beacon(hw);
@@ -2184,7 +2183,7 @@ void rtl92cu_update_channel_access_setting(struct ieee80211_hw *hw)
2184 u16 sifs_timer; 2183 u16 sifs_timer;
2185 2184
2186 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME, 2185 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME,
2187 (u8 *)&mac->slot_time); 2186 &mac->slot_time);
2188 if (!mac->ht_enable) 2187 if (!mac->ht_enable)
2189 sifs_timer = 0x0a0a; 2188 sifs_timer = 0x0a0a;
2190 else 2189 else
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
index 21bc827c5fa6..2e6eb356a93e 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
@@ -668,7 +668,7 @@ void rtl92cu_tx_fill_cmddesc(struct ieee80211_hw *hw,
668 SET_TX_DESC_RATE_ID(pdesc, 7); 668 SET_TX_DESC_RATE_ID(pdesc, 7);
669 SET_TX_DESC_MACID(pdesc, 0); 669 SET_TX_DESC_MACID(pdesc, 0);
670 SET_TX_DESC_OWN(pdesc, 1); 670 SET_TX_DESC_OWN(pdesc, 1);
671 SET_TX_DESC_PKT_SIZE((u8 *) pdesc, (u16) (skb->len)); 671 SET_TX_DESC_PKT_SIZE(pdesc, (u16)skb->len);
672 SET_TX_DESC_FIRST_SEG(pdesc, 1); 672 SET_TX_DESC_FIRST_SEG(pdesc, 1);
673 SET_TX_DESC_LAST_SEG(pdesc, 1); 673 SET_TX_DESC_LAST_SEG(pdesc, 1);
674 SET_TX_DESC_OFFSET(pdesc, 0x20); 674 SET_TX_DESC_OFFSET(pdesc, 0x20);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/dm.c b/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
index a7d63a84551a..c0201ed69dd7 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
@@ -696,7 +696,7 @@ static void rtl92d_dm_check_edca_turbo(struct ieee80211_hw *hw)
696 if (rtlpriv->dm.current_turbo_edca) { 696 if (rtlpriv->dm.current_turbo_edca) {
697 u8 tmp = AC0_BE; 697 u8 tmp = AC0_BE;
698 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AC_PARAM, 698 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AC_PARAM,
699 (u8 *) (&tmp)); 699 &tmp);
700 rtlpriv->dm.current_turbo_edca = false; 700 rtlpriv->dm.current_turbo_edca = false;
701 } 701 }
702 } 702 }
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/fw.c b/drivers/net/wireless/rtlwifi/rtl8192de/fw.c
index f548a8d0068d..895ae6c1f354 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/fw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/fw.c
@@ -120,7 +120,7 @@ static void _rtl92d_write_fw(struct ieee80211_hw *hw,
120{ 120{
121 struct rtl_priv *rtlpriv = rtl_priv(hw); 121 struct rtl_priv *rtlpriv = rtl_priv(hw);
122 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 122 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
123 u8 *bufferPtr = (u8 *) buffer; 123 u8 *bufferPtr = buffer;
124 u32 pagenums, remainSize; 124 u32 pagenums, remainSize;
125 u32 page, offset; 125 u32 page, offset;
126 126
@@ -256,8 +256,8 @@ int rtl92d_download_fw(struct ieee80211_hw *hw)
256 if (rtlpriv->max_fw_size == 0 || !rtlhal->pfirmware) 256 if (rtlpriv->max_fw_size == 0 || !rtlhal->pfirmware)
257 return 1; 257 return 1;
258 fwsize = rtlhal->fwsize; 258 fwsize = rtlhal->fwsize;
259 pfwheader = (u8 *) rtlhal->pfirmware; 259 pfwheader = rtlhal->pfirmware;
260 pfwdata = (u8 *) rtlhal->pfirmware; 260 pfwdata = rtlhal->pfirmware;
261 rtlhal->fw_version = (u16) GET_FIRMWARE_HDR_VERSION(pfwheader); 261 rtlhal->fw_version = (u16) GET_FIRMWARE_HDR_VERSION(pfwheader);
262 rtlhal->fw_subversion = (u16) GET_FIRMWARE_HDR_SUB_VER(pfwheader); 262 rtlhal->fw_subversion = (u16) GET_FIRMWARE_HDR_SUB_VER(pfwheader);
263 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 263 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
index b338d526c422..f4051f4f0390 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
@@ -235,12 +235,12 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
235 for (e_aci = 0; e_aci < AC_MAX; e_aci++) 235 for (e_aci = 0; e_aci < AC_MAX; e_aci++)
236 rtlpriv->cfg->ops->set_hw_reg(hw, 236 rtlpriv->cfg->ops->set_hw_reg(hw,
237 HW_VAR_AC_PARAM, 237 HW_VAR_AC_PARAM,
238 (u8 *) (&e_aci)); 238 (&e_aci));
239 break; 239 break;
240 } 240 }
241 case HW_VAR_ACK_PREAMBLE: { 241 case HW_VAR_ACK_PREAMBLE: {
242 u8 reg_tmp; 242 u8 reg_tmp;
243 u8 short_preamble = (bool) (*(u8 *) val); 243 u8 short_preamble = (bool) (*val);
244 244
245 reg_tmp = (mac->cur_40_prime_sc) << 5; 245 reg_tmp = (mac->cur_40_prime_sc) << 5;
246 if (short_preamble) 246 if (short_preamble)
@@ -252,7 +252,7 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
252 u8 min_spacing_to_set; 252 u8 min_spacing_to_set;
253 u8 sec_min_space; 253 u8 sec_min_space;
254 254
255 min_spacing_to_set = *((u8 *) val); 255 min_spacing_to_set = *val;
256 if (min_spacing_to_set <= 7) { 256 if (min_spacing_to_set <= 7) {
257 sec_min_space = 0; 257 sec_min_space = 0;
258 if (min_spacing_to_set < sec_min_space) 258 if (min_spacing_to_set < sec_min_space)
@@ -271,7 +271,7 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
271 case HW_VAR_SHORTGI_DENSITY: { 271 case HW_VAR_SHORTGI_DENSITY: {
272 u8 density_to_set; 272 u8 density_to_set;
273 273
274 density_to_set = *((u8 *) val); 274 density_to_set = *val;
275 mac->min_space_cfg = rtlpriv->rtlhal.minspace_cfg; 275 mac->min_space_cfg = rtlpriv->rtlhal.minspace_cfg;
276 mac->min_space_cfg |= (density_to_set << 3); 276 mac->min_space_cfg |= (density_to_set << 3);
277 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 277 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
@@ -293,7 +293,7 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
293 regtoSet = 0x66626641; 293 regtoSet = 0x66626641;
294 else 294 else
295 regtoSet = 0xb972a841; 295 regtoSet = 0xb972a841;
296 factor_toset = *((u8 *) val); 296 factor_toset = *val;
297 if (factor_toset <= 3) { 297 if (factor_toset <= 3) {
298 factor_toset = (1 << (factor_toset + 2)); 298 factor_toset = (1 << (factor_toset + 2));
299 if (factor_toset > 0xf) 299 if (factor_toset > 0xf)
@@ -316,15 +316,15 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
316 break; 316 break;
317 } 317 }
318 case HW_VAR_AC_PARAM: { 318 case HW_VAR_AC_PARAM: {
319 u8 e_aci = *((u8 *) val); 319 u8 e_aci = *val;
320 rtl92d_dm_init_edca_turbo(hw); 320 rtl92d_dm_init_edca_turbo(hw);
321 if (rtlpci->acm_method != eAcmWay2_SW) 321 if (rtlpci->acm_method != eAcmWay2_SW)
322 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ACM_CTRL, 322 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ACM_CTRL,
323 (u8 *) (&e_aci)); 323 &e_aci);
324 break; 324 break;
325 } 325 }
326 case HW_VAR_ACM_CTRL: { 326 case HW_VAR_ACM_CTRL: {
327 u8 e_aci = *((u8 *) val); 327 u8 e_aci = *val;
328 union aci_aifsn *p_aci_aifsn = 328 union aci_aifsn *p_aci_aifsn =
329 (union aci_aifsn *)(&(mac->ac[0].aifs)); 329 (union aci_aifsn *)(&(mac->ac[0].aifs));
330 u8 acm = p_aci_aifsn->f.acm; 330 u8 acm = p_aci_aifsn->f.acm;
@@ -376,7 +376,7 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
376 rtlpci->receive_config = ((u32 *) (val))[0]; 376 rtlpci->receive_config = ((u32 *) (val))[0];
377 break; 377 break;
378 case HW_VAR_RETRY_LIMIT: { 378 case HW_VAR_RETRY_LIMIT: {
379 u8 retry_limit = ((u8 *) (val))[0]; 379 u8 retry_limit = val[0];
380 380
381 rtl_write_word(rtlpriv, REG_RL, 381 rtl_write_word(rtlpriv, REG_RL,
382 retry_limit << RETRY_LIMIT_SHORT_SHIFT | 382 retry_limit << RETRY_LIMIT_SHORT_SHIFT |
@@ -390,16 +390,16 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
390 rtlefuse->efuse_usedbytes = *((u16 *) val); 390 rtlefuse->efuse_usedbytes = *((u16 *) val);
391 break; 391 break;
392 case HW_VAR_EFUSE_USAGE: 392 case HW_VAR_EFUSE_USAGE:
393 rtlefuse->efuse_usedpercentage = *((u8 *) val); 393 rtlefuse->efuse_usedpercentage = *val;
394 break; 394 break;
395 case HW_VAR_IO_CMD: 395 case HW_VAR_IO_CMD:
396 rtl92d_phy_set_io_cmd(hw, (*(enum io_type *)val)); 396 rtl92d_phy_set_io_cmd(hw, (*(enum io_type *)val));
397 break; 397 break;
398 case HW_VAR_WPA_CONFIG: 398 case HW_VAR_WPA_CONFIG:
399 rtl_write_byte(rtlpriv, REG_SECCFG, *((u8 *) val)); 399 rtl_write_byte(rtlpriv, REG_SECCFG, *val);
400 break; 400 break;
401 case HW_VAR_SET_RPWM: 401 case HW_VAR_SET_RPWM:
402 rtl92d_fill_h2c_cmd(hw, H2C_PWRM, 1, (u8 *) (val)); 402 rtl92d_fill_h2c_cmd(hw, H2C_PWRM, 1, (val));
403 break; 403 break;
404 case HW_VAR_H2C_FW_PWRMODE: 404 case HW_VAR_H2C_FW_PWRMODE:
405 break; 405 break;
@@ -407,7 +407,7 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
407 ppsc->fw_current_inpsmode = *((bool *) val); 407 ppsc->fw_current_inpsmode = *((bool *) val);
408 break; 408 break;
409 case HW_VAR_H2C_FW_JOINBSSRPT: { 409 case HW_VAR_H2C_FW_JOINBSSRPT: {
410 u8 mstatus = (*(u8 *) val); 410 u8 mstatus = (*val);
411 u8 tmp_regcr, tmp_reg422; 411 u8 tmp_regcr, tmp_reg422;
412 bool recover = false; 412 bool recover = false;
413 413
@@ -435,7 +435,7 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
435 rtl_write_byte(rtlpriv, REG_CR + 1, 435 rtl_write_byte(rtlpriv, REG_CR + 1,
436 (tmp_regcr & ~(BIT(0)))); 436 (tmp_regcr & ~(BIT(0))));
437 } 437 }
438 rtl92d_set_fw_joinbss_report_cmd(hw, (*(u8 *) val)); 438 rtl92d_set_fw_joinbss_report_cmd(hw, (*val));
439 break; 439 break;
440 } 440 }
441 case HW_VAR_AID: { 441 case HW_VAR_AID: {
@@ -447,7 +447,7 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
447 break; 447 break;
448 } 448 }
449 case HW_VAR_CORRECT_TSF: { 449 case HW_VAR_CORRECT_TSF: {
450 u8 btype_ibss = ((u8 *) (val))[0]; 450 u8 btype_ibss = val[0];
451 451
452 if (btype_ibss) 452 if (btype_ibss)
453 _rtl92de_stop_tx_beacon(hw); 453 _rtl92de_stop_tx_beacon(hw);
@@ -1794,7 +1794,7 @@ static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw)
1794 "RTL819X Not boot from eeprom, check it !!\n"); 1794 "RTL819X Not boot from eeprom, check it !!\n");
1795 return; 1795 return;
1796 } 1796 }
1797 rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMER_ID]; 1797 rtlefuse->eeprom_oemid = hwinfo[EEPROM_CUSTOMER_ID];
1798 _rtl92de_read_macphymode_and_bandtype(hw, hwinfo); 1798 _rtl92de_read_macphymode_and_bandtype(hw, hwinfo);
1799 1799
1800 /* VID, DID SE 0xA-D */ 1800 /* VID, DID SE 0xA-D */
@@ -2115,7 +2115,7 @@ void rtl92de_update_channel_access_setting(struct ieee80211_hw *hw)
2115 u16 sifs_timer; 2115 u16 sifs_timer;
2116 2116
2117 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME, 2117 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME,
2118 (u8 *)&mac->slot_time); 2118 &mac->slot_time);
2119 if (!mac->ht_enable) 2119 if (!mac->ht_enable)
2120 sifs_timer = 0x0a0a; 2120 sifs_timer = 0x0a0a;
2121 else 2121 else
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
index 1666ef7fd87b..f80690d82c11 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
@@ -560,7 +560,7 @@ void rtl92de_tx_fill_desc(struct ieee80211_hw *hw,
560 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); 560 struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
561 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); 561 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
562 struct ieee80211_sta *sta = info->control.sta; 562 struct ieee80211_sta *sta = info->control.sta;
563 u8 *pdesc = (u8 *) pdesc_tx; 563 u8 *pdesc = pdesc_tx;
564 u16 seq_number; 564 u16 seq_number;
565 __le16 fc = hdr->frame_control; 565 __le16 fc = hdr->frame_control;
566 unsigned int buf_len = 0; 566 unsigned int buf_len = 0;
@@ -761,11 +761,11 @@ void rtl92de_tx_fill_cmddesc(struct ieee80211_hw *hw,
761 SET_TX_DESC_QUEUE_SEL(pdesc, fw_queue); 761 SET_TX_DESC_QUEUE_SEL(pdesc, fw_queue);
762 SET_TX_DESC_FIRST_SEG(pdesc, 1); 762 SET_TX_DESC_FIRST_SEG(pdesc, 1);
763 SET_TX_DESC_LAST_SEG(pdesc, 1); 763 SET_TX_DESC_LAST_SEG(pdesc, 1);
764 SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16) (skb->len)); 764 SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)skb->len);
765 SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping); 765 SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping);
766 SET_TX_DESC_RATE_ID(pdesc, 7); 766 SET_TX_DESC_RATE_ID(pdesc, 7);
767 SET_TX_DESC_MACID(pdesc, 0); 767 SET_TX_DESC_MACID(pdesc, 0);
768 SET_TX_DESC_PKT_SIZE((u8 *) pdesc, (u16) (skb->len)); 768 SET_TX_DESC_PKT_SIZE(pdesc, (u16) (skb->len));
769 SET_TX_DESC_FIRST_SEG(pdesc, 1); 769 SET_TX_DESC_FIRST_SEG(pdesc, 1);
770 SET_TX_DESC_LAST_SEG(pdesc, 1); 770 SET_TX_DESC_LAST_SEG(pdesc, 1);
771 SET_TX_DESC_OFFSET(pdesc, 0x20); 771 SET_TX_DESC_OFFSET(pdesc, 0x20);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/dm.c b/drivers/net/wireless/rtlwifi/rtl8192se/dm.c
index 2e1158026fb7..465f58157101 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/dm.c
@@ -146,7 +146,7 @@ static void _rtl92s_dm_check_edca_turbo(struct ieee80211_hw *hw)
146 if (rtlpriv->dm.current_turbo_edca) { 146 if (rtlpriv->dm.current_turbo_edca) {
147 u8 tmp = AC0_BE; 147 u8 tmp = AC0_BE;
148 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AC_PARAM, 148 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AC_PARAM,
149 (u8 *)(&tmp)); 149 &tmp);
150 rtlpriv->dm.current_turbo_edca = false; 150 rtlpriv->dm.current_turbo_edca = false;
151 } 151 }
152 } 152 }
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
index b141c35bf926..4542e6952b97 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
@@ -145,13 +145,13 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
145 for (e_aci = 0; e_aci < AC_MAX; e_aci++) { 145 for (e_aci = 0; e_aci < AC_MAX; e_aci++) {
146 rtlpriv->cfg->ops->set_hw_reg(hw, 146 rtlpriv->cfg->ops->set_hw_reg(hw,
147 HW_VAR_AC_PARAM, 147 HW_VAR_AC_PARAM,
148 (u8 *)(&e_aci)); 148 (&e_aci));
149 } 149 }
150 break; 150 break;
151 } 151 }
152 case HW_VAR_ACK_PREAMBLE:{ 152 case HW_VAR_ACK_PREAMBLE:{
153 u8 reg_tmp; 153 u8 reg_tmp;
154 u8 short_preamble = (bool) (*(u8 *) val); 154 u8 short_preamble = (bool) (*val);
155 reg_tmp = (mac->cur_40_prime_sc) << 5; 155 reg_tmp = (mac->cur_40_prime_sc) << 5;
156 if (short_preamble) 156 if (short_preamble)
157 reg_tmp |= 0x80; 157 reg_tmp |= 0x80;
@@ -163,7 +163,7 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
163 u8 min_spacing_to_set; 163 u8 min_spacing_to_set;
164 u8 sec_min_space; 164 u8 sec_min_space;
165 165
166 min_spacing_to_set = *((u8 *)val); 166 min_spacing_to_set = *val;
167 if (min_spacing_to_set <= 7) { 167 if (min_spacing_to_set <= 7) {
168 if (rtlpriv->sec.pairwise_enc_algorithm == 168 if (rtlpriv->sec.pairwise_enc_algorithm ==
169 NO_ENCRYPTION) 169 NO_ENCRYPTION)
@@ -194,7 +194,7 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
194 case HW_VAR_SHORTGI_DENSITY:{ 194 case HW_VAR_SHORTGI_DENSITY:{
195 u8 density_to_set; 195 u8 density_to_set;
196 196
197 density_to_set = *((u8 *) val); 197 density_to_set = *val;
198 mac->min_space_cfg = rtlpriv->rtlhal.minspace_cfg; 198 mac->min_space_cfg = rtlpriv->rtlhal.minspace_cfg;
199 mac->min_space_cfg |= (density_to_set << 3); 199 mac->min_space_cfg |= (density_to_set << 3);
200 200
@@ -216,7 +216,7 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
216 15, 15, 15, 15, 0}; 216 15, 15, 15, 15, 0};
217 u8 index = 0; 217 u8 index = 0;
218 218
219 factor_toset = *((u8 *) val); 219 factor_toset = *val;
220 if (factor_toset <= 3) { 220 if (factor_toset <= 3) {
221 factor_toset = (1 << (factor_toset + 2)); 221 factor_toset = (1 << (factor_toset + 2));
222 if (factor_toset > 0xf) 222 if (factor_toset > 0xf)
@@ -248,17 +248,17 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
248 break; 248 break;
249 } 249 }
250 case HW_VAR_AC_PARAM:{ 250 case HW_VAR_AC_PARAM:{
251 u8 e_aci = *((u8 *) val); 251 u8 e_aci = *val;
252 rtl92s_dm_init_edca_turbo(hw); 252 rtl92s_dm_init_edca_turbo(hw);
253 253
254 if (rtlpci->acm_method != eAcmWay2_SW) 254 if (rtlpci->acm_method != eAcmWay2_SW)
255 rtlpriv->cfg->ops->set_hw_reg(hw, 255 rtlpriv->cfg->ops->set_hw_reg(hw,
256 HW_VAR_ACM_CTRL, 256 HW_VAR_ACM_CTRL,
257 (u8 *)(&e_aci)); 257 &e_aci);
258 break; 258 break;
259 } 259 }
260 case HW_VAR_ACM_CTRL:{ 260 case HW_VAR_ACM_CTRL:{
261 u8 e_aci = *((u8 *) val); 261 u8 e_aci = *val;
262 union aci_aifsn *p_aci_aifsn = (union aci_aifsn *)(&( 262 union aci_aifsn *p_aci_aifsn = (union aci_aifsn *)(&(
263 mac->ac[0].aifs)); 263 mac->ac[0].aifs));
264 u8 acm = p_aci_aifsn->f.acm; 264 u8 acm = p_aci_aifsn->f.acm;
@@ -313,7 +313,7 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
313 break; 313 break;
314 } 314 }
315 case HW_VAR_RETRY_LIMIT:{ 315 case HW_VAR_RETRY_LIMIT:{
316 u8 retry_limit = ((u8 *) (val))[0]; 316 u8 retry_limit = val[0];
317 317
318 rtl_write_word(rtlpriv, RETRY_LIMIT, 318 rtl_write_word(rtlpriv, RETRY_LIMIT,
319 retry_limit << RETRY_LIMIT_SHORT_SHIFT | 319 retry_limit << RETRY_LIMIT_SHORT_SHIFT |
@@ -328,14 +328,14 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
328 break; 328 break;
329 } 329 }
330 case HW_VAR_EFUSE_USAGE: { 330 case HW_VAR_EFUSE_USAGE: {
331 rtlefuse->efuse_usedpercentage = *((u8 *) val); 331 rtlefuse->efuse_usedpercentage = *val;
332 break; 332 break;
333 } 333 }
334 case HW_VAR_IO_CMD: { 334 case HW_VAR_IO_CMD: {
335 break; 335 break;
336 } 336 }
337 case HW_VAR_WPA_CONFIG: { 337 case HW_VAR_WPA_CONFIG: {
338 rtl_write_byte(rtlpriv, REG_SECR, *((u8 *) val)); 338 rtl_write_byte(rtlpriv, REG_SECR, *val);
339 break; 339 break;
340 } 340 }
341 case HW_VAR_SET_RPWM:{ 341 case HW_VAR_SET_RPWM:{
@@ -1813,8 +1813,7 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1813 else 1813 else
1814 index = 2; 1814 index = 2;
1815 1815
1816 tempval = (*(u8 *)&hwinfo[EEPROM_TX_PWR_HT20_DIFF + 1816 tempval = hwinfo[EEPROM_TX_PWR_HT20_DIFF + index] & 0xff;
1817 index]) & 0xff;
1818 rtlefuse->txpwr_ht20diff[RF90_PATH_A][i] = (tempval & 0xF); 1817 rtlefuse->txpwr_ht20diff[RF90_PATH_A][i] = (tempval & 0xF);
1819 rtlefuse->txpwr_ht20diff[RF90_PATH_B][i] = 1818 rtlefuse->txpwr_ht20diff[RF90_PATH_B][i] =
1820 ((tempval >> 4) & 0xF); 1819 ((tempval >> 4) & 0xF);
@@ -1830,14 +1829,13 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1830 else 1829 else
1831 index = 1; 1830 index = 1;
1832 1831
1833 tempval = (*(u8 *)&hwinfo[EEPROM_TX_PWR_OFDM_DIFF + index]) 1832 tempval = hwinfo[EEPROM_TX_PWR_OFDM_DIFF + index] & 0xff;
1834 & 0xff;
1835 rtlefuse->txpwr_legacyhtdiff[RF90_PATH_A][i] = 1833 rtlefuse->txpwr_legacyhtdiff[RF90_PATH_A][i] =
1836 (tempval & 0xF); 1834 (tempval & 0xF);
1837 rtlefuse->txpwr_legacyhtdiff[RF90_PATH_B][i] = 1835 rtlefuse->txpwr_legacyhtdiff[RF90_PATH_B][i] =
1838 ((tempval >> 4) & 0xF); 1836 ((tempval >> 4) & 0xF);
1839 1837
1840 tempval = (*(u8 *)&hwinfo[TX_PWR_SAFETY_CHK]); 1838 tempval = hwinfo[TX_PWR_SAFETY_CHK];
1841 rtlefuse->txpwr_safetyflag = (tempval & 0x01); 1839 rtlefuse->txpwr_safetyflag = (tempval & 0x01);
1842 } 1840 }
1843 1841
@@ -1876,7 +1874,7 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1876 1874
1877 /* Read RF-indication and Tx Power gain 1875 /* Read RF-indication and Tx Power gain
1878 * index diff of legacy to HT OFDM rate. */ 1876 * index diff of legacy to HT OFDM rate. */
1879 tempval = (*(u8 *)&hwinfo[EEPROM_RFIND_POWERDIFF]) & 0xff; 1877 tempval = hwinfo[EEPROM_RFIND_POWERDIFF] & 0xff;
1880 rtlefuse->eeprom_txpowerdiff = tempval; 1878 rtlefuse->eeprom_txpowerdiff = tempval;
1881 rtlefuse->legacy_httxpowerdiff = 1879 rtlefuse->legacy_httxpowerdiff =
1882 rtlefuse->txpwr_legacyhtdiff[RF90_PATH_A][0]; 1880 rtlefuse->txpwr_legacyhtdiff[RF90_PATH_A][0];
@@ -1887,7 +1885,7 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1887 /* Get TSSI value for each path. */ 1885 /* Get TSSI value for each path. */
1888 usvalue = *(u16 *)&hwinfo[EEPROM_TSSI_A]; 1886 usvalue = *(u16 *)&hwinfo[EEPROM_TSSI_A];
1889 rtlefuse->eeprom_tssi[RF90_PATH_A] = (u8)((usvalue & 0xff00) >> 8); 1887 rtlefuse->eeprom_tssi[RF90_PATH_A] = (u8)((usvalue & 0xff00) >> 8);
1890 usvalue = *(u8 *)&hwinfo[EEPROM_TSSI_B]; 1888 usvalue = hwinfo[EEPROM_TSSI_B];
1891 rtlefuse->eeprom_tssi[RF90_PATH_B] = (u8)(usvalue & 0xff); 1889 rtlefuse->eeprom_tssi[RF90_PATH_B] = (u8)(usvalue & 0xff);
1892 1890
1893 RTPRINT(rtlpriv, FINIT, INIT_TxPower, "TSSI_A = 0x%x, TSSI_B = 0x%x\n", 1891 RTPRINT(rtlpriv, FINIT, INIT_TxPower, "TSSI_A = 0x%x, TSSI_B = 0x%x\n",
@@ -1896,7 +1894,7 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1896 1894
1897 /* Read antenna tx power offset of B/C/D to A from EEPROM */ 1895 /* Read antenna tx power offset of B/C/D to A from EEPROM */
1898 /* and read ThermalMeter from EEPROM */ 1896 /* and read ThermalMeter from EEPROM */
1899 tempval = *(u8 *)&hwinfo[EEPROM_THERMALMETER]; 1897 tempval = hwinfo[EEPROM_THERMALMETER];
1900 rtlefuse->eeprom_thermalmeter = tempval; 1898 rtlefuse->eeprom_thermalmeter = tempval;
1901 RTPRINT(rtlpriv, FINIT, INIT_TxPower, 1899 RTPRINT(rtlpriv, FINIT, INIT_TxPower,
1902 "thermalmeter = 0x%x\n", rtlefuse->eeprom_thermalmeter); 1900 "thermalmeter = 0x%x\n", rtlefuse->eeprom_thermalmeter);
@@ -1906,20 +1904,20 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1906 rtlefuse->tssi_13dbm = rtlefuse->eeprom_thermalmeter * 100; 1904 rtlefuse->tssi_13dbm = rtlefuse->eeprom_thermalmeter * 100;
1907 1905
1908 /* Read CrystalCap from EEPROM */ 1906 /* Read CrystalCap from EEPROM */
1909 tempval = (*(u8 *)&hwinfo[EEPROM_CRYSTALCAP]) >> 4; 1907 tempval = hwinfo[EEPROM_CRYSTALCAP] >> 4;
1910 rtlefuse->eeprom_crystalcap = tempval; 1908 rtlefuse->eeprom_crystalcap = tempval;
1911 /* CrystalCap, BIT(12)~15 */ 1909 /* CrystalCap, BIT(12)~15 */
1912 rtlefuse->crystalcap = rtlefuse->eeprom_crystalcap; 1910 rtlefuse->crystalcap = rtlefuse->eeprom_crystalcap;
1913 1911
1914 /* Read IC Version && Channel Plan */ 1912 /* Read IC Version && Channel Plan */
1915 /* Version ID, Channel plan */ 1913 /* Version ID, Channel plan */
1916 rtlefuse->eeprom_channelplan = *(u8 *)&hwinfo[EEPROM_CHANNELPLAN]; 1914 rtlefuse->eeprom_channelplan = hwinfo[EEPROM_CHANNELPLAN];
1917 rtlefuse->txpwr_fromeprom = true; 1915 rtlefuse->txpwr_fromeprom = true;
1918 RTPRINT(rtlpriv, FINIT, INIT_TxPower, 1916 RTPRINT(rtlpriv, FINIT, INIT_TxPower,
1919 "EEPROM ChannelPlan = 0x%4x\n", rtlefuse->eeprom_channelplan); 1917 "EEPROM ChannelPlan = 0x%4x\n", rtlefuse->eeprom_channelplan);
1920 1918
1921 /* Read Customer ID or Board Type!!! */ 1919 /* Read Customer ID or Board Type!!! */
1922 tempval = *(u8 *)&hwinfo[EEPROM_BOARDTYPE]; 1920 tempval = hwinfo[EEPROM_BOARDTYPE];
1923 /* Change RF type definition */ 1921 /* Change RF type definition */
1924 if (tempval == 0) 1922 if (tempval == 0)
1925 rtlphy->rf_type = RF_2T2R; 1923 rtlphy->rf_type = RF_2T2R;
@@ -1941,7 +1939,7 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1941 } 1939 }
1942 } 1940 }
1943 rtlefuse->b1ss_support = rtlefuse->b1x1_recvcombine; 1941 rtlefuse->b1ss_support = rtlefuse->b1x1_recvcombine;
1944 rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMID]; 1942 rtlefuse->eeprom_oemid = *&hwinfo[EEPROM_CUSTOMID];
1945 1943
1946 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "EEPROM Customer ID: 0x%2x", 1944 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "EEPROM Customer ID: 0x%2x",
1947 rtlefuse->eeprom_oemid); 1945 rtlefuse->eeprom_oemid);
@@ -2251,7 +2249,7 @@ void rtl92se_update_channel_access_setting(struct ieee80211_hw *hw)
2251 u16 sifs_timer; 2249 u16 sifs_timer;
2252 2250
2253 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME, 2251 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME,
2254 (u8 *)&mac->slot_time); 2252 &mac->slot_time);
2255 sifs_timer = 0x0e0e; 2253 sifs_timer = 0x0e0e;
2256 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SIFS, (u8 *)&sifs_timer); 2254 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SIFS, (u8 *)&sifs_timer);
2257 2255
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
index 812b5858f14a..36d1cb3aef8a 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
@@ -599,7 +599,7 @@ void rtl92se_tx_fill_desc(struct ieee80211_hw *hw,
599 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 599 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
600 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 600 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
601 struct ieee80211_sta *sta = info->control.sta; 601 struct ieee80211_sta *sta = info->control.sta;
602 u8 *pdesc = (u8 *) pdesc_tx; 602 u8 *pdesc = pdesc_tx;
603 u16 seq_number; 603 u16 seq_number;
604 __le16 fc = hdr->frame_control; 604 __le16 fc = hdr->frame_control;
605 u8 reserved_macid = 0; 605 u8 reserved_macid = 0;