aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
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
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')
-rw-r--r--drivers/net/wireless/adm8211.c3
-rw-r--r--drivers/net/wireless/airo.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_eeprom.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_4k.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_def.c3
-rw-r--r--drivers/net/wireless/ath/carl9170/cmd.c2
-rw-r--r--drivers/net/wireless/ath/carl9170/rx.c4
-rw-r--r--drivers/net/wireless/atmel.c4
-rw-r--r--drivers/net/wireless/b43legacy/dma.c2
-rw-r--r--drivers/net/wireless/b43legacy/xmit.c6
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c4
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/dma.c2
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.c2
-rw-r--r--drivers/net/wireless/hostap/hostap_proc.c3
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-testmode.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie.c2
-rw-r--r--drivers/net/wireless/libertas/debugfs.c4
-rw-r--r--drivers/net/wireless/libertas/if_usb.c2
-rw-r--r--drivers/net/wireless/libertas_tf/if_usb.c2
-rw-r--r--drivers/net/wireless/mwifiex/11n.c14
-rw-r--r--drivers/net/wireless/mwifiex/11n.h3
-rw-r--r--drivers/net/wireless/mwifiex/11n_rxreorder.c18
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c2
-rw-r--r--drivers/net/wireless/mwifiex/join.c20
-rw-r--r--drivers/net/wireless/mwifiex/scan.c24
-rw-r--r--drivers/net/wireless/mwifiex/sta_cmd.c16
-rw-r--r--drivers/net/wireless/mwifiex/sta_cmdresp.c24
-rw-r--r--drivers/net/wireless/mwifiex/sta_event.c2
-rw-r--r--drivers/net/wireless/p54/eeprom.c2
-rw-r--r--drivers/net/wireless/p54/fwio.c2
-rw-r--r--drivers/net/wireless/prism54/islpci_eth.c2
-rw-r--r--drivers/net/wireless/ray_cs.c2
-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
-rw-r--r--drivers/net/wireless/ti/wlcore/tx.c3
-rw-r--r--drivers/net/wireless/zd1211rw/zd_chip.h2
-rw-r--r--drivers/net/wireless/zd1211rw/zd_usb.h2
55 files changed, 198 insertions, 247 deletions
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index 0ac09a2bd144..97afcec24759 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -1738,8 +1738,7 @@ static int adm8211_alloc_rings(struct ieee80211_hw *dev)
1738 return -ENOMEM; 1738 return -ENOMEM;
1739 } 1739 }
1740 1740
1741 priv->tx_ring = (struct adm8211_desc *)(priv->rx_ring + 1741 priv->tx_ring = priv->rx_ring + priv->rx_ring_size;
1742 priv->rx_ring_size);
1743 priv->tx_ring_dma = priv->rx_ring_dma + 1742 priv->tx_ring_dma = priv->rx_ring_dma +
1744 sizeof(struct adm8211_desc) * priv->rx_ring_size; 1743 sizeof(struct adm8211_desc) * priv->rx_ring_size;
1745 1744
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 520a4b2eb9cc..252c2c2d76c1 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -1997,7 +1997,7 @@ static int mpi_send_packet (struct net_device *dev)
1997 * ------------------------------------------------ 1997 * ------------------------------------------------
1998 */ 1998 */
1999 1999
2000 memcpy((char *)ai->txfids[0].virtual_host_addr, 2000 memcpy(ai->txfids[0].virtual_host_addr,
2001 (char *)&wifictlhdr8023, sizeof(wifictlhdr8023)); 2001 (char *)&wifictlhdr8023, sizeof(wifictlhdr8023));
2002 2002
2003 payloadLen = (__le16 *)(ai->txfids[0].virtual_host_addr + 2003 payloadLen = (__le16 *)(ai->txfids[0].virtual_host_addr +
@@ -4212,7 +4212,7 @@ static int PC4500_writerid(struct airo_info *ai, u16 rid,
4212 airo_print_err(ai->dev->name, "%s: len=%d", __func__, len); 4212 airo_print_err(ai->dev->name, "%s: len=%d", __func__, len);
4213 rc = -1; 4213 rc = -1;
4214 } else { 4214 } else {
4215 memcpy((char *)ai->config_desc.virtual_host_addr, 4215 memcpy(ai->config_desc.virtual_host_addr,
4216 pBuf, len); 4216 pBuf, len);
4217 4217
4218 rc = issuecommand(ai, &cmd, &rsp); 4218 rc = issuecommand(ai, &cmd, &rsp);
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index dfb0441f406c..ca881558da78 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -3178,7 +3178,7 @@ static int ar9300_compress_decision(struct ath_hw *ah,
3178 mdata_size, length); 3178 mdata_size, length);
3179 return -1; 3179 return -1;
3180 } 3180 }
3181 memcpy(mptr, (u8 *) (word + COMP_HDR_LEN), length); 3181 memcpy(mptr, word + COMP_HDR_LEN, length);
3182 ath_dbg(common, EEPROM, 3182 ath_dbg(common, EEPROM,
3183 "restored eeprom %d: uncompressed, length %d\n", 3183 "restored eeprom %d: uncompressed, length %d\n",
3184 it, length); 3184 it, length);
@@ -3199,7 +3199,7 @@ static int ar9300_compress_decision(struct ath_hw *ah,
3199 "restore eeprom %d: block, reference %d, length %d\n", 3199 "restore eeprom %d: block, reference %d, length %d\n",
3200 it, reference, length); 3200 it, reference, length);
3201 ar9300_uncompress_block(ah, mptr, mdata_size, 3201 ar9300_uncompress_block(ah, mptr, mdata_size,
3202 (u8 *) (word + COMP_HDR_LEN), length); 3202 (word + COMP_HDR_LEN), length);
3203 break; 3203 break;
3204 default: 3204 default:
3205 ath_dbg(common, EEPROM, "unknown compression code %d\n", code); 3205 ath_dbg(common, EEPROM, "unknown compression code %d\n", code);
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
index 4322ac80c203..92543d166fe9 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
@@ -188,8 +188,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
188{ 188{
189#define EEPROM_4K_SIZE (sizeof(struct ar5416_eeprom_4k) / sizeof(u16)) 189#define EEPROM_4K_SIZE (sizeof(struct ar5416_eeprom_4k) / sizeof(u16))
190 struct ath_common *common = ath9k_hw_common(ah); 190 struct ath_common *common = ath9k_hw_common(ah);
191 struct ar5416_eeprom_4k *eep = 191 struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k;
192 (struct ar5416_eeprom_4k *) &ah->eeprom.map4k;
193 u16 *eepdata, temp, magic, magic2; 192 u16 *eepdata, temp, magic, magic2;
194 u32 sum = 0, el; 193 u32 sum = 0, el;
195 bool need_swap = false; 194 bool need_swap = false;
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c
index b5fba8b18b8b..a9f071bc643a 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -264,8 +264,7 @@ static u32 ath9k_hw_def_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
264 264
265static int ath9k_hw_def_check_eeprom(struct ath_hw *ah) 265static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
266{ 266{
267 struct ar5416_eeprom_def *eep = 267 struct ar5416_eeprom_def *eep = &ah->eeprom.def;
268 (struct ar5416_eeprom_def *) &ah->eeprom.def;
269 struct ath_common *common = ath9k_hw_common(ah); 268 struct ath_common *common = ath9k_hw_common(ah);
270 u16 *eepdata, temp, magic, magic2; 269 u16 *eepdata, temp, magic, magic2;
271 u32 sum = 0, el; 270 u32 sum = 0, el;
diff --git a/drivers/net/wireless/ath/carl9170/cmd.c b/drivers/net/wireless/ath/carl9170/cmd.c
index 195dc6538110..39a63874b275 100644
--- a/drivers/net/wireless/ath/carl9170/cmd.c
+++ b/drivers/net/wireless/ath/carl9170/cmd.c
@@ -138,7 +138,7 @@ int carl9170_reboot(struct ar9170 *ar)
138 if (!cmd) 138 if (!cmd)
139 return -ENOMEM; 139 return -ENOMEM;
140 140
141 err = __carl9170_exec_cmd(ar, (struct carl9170_cmd *)cmd, true); 141 err = __carl9170_exec_cmd(ar, cmd, true);
142 return err; 142 return err;
143} 143}
144 144
diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c
index 84b22eec7abd..7a8e90eaad83 100644
--- a/drivers/net/wireless/ath/carl9170/rx.c
+++ b/drivers/net/wireless/ath/carl9170/rx.c
@@ -161,7 +161,7 @@ static void carl9170_cmd_callback(struct ar9170 *ar, u32 len, void *buffer)
161 161
162void carl9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len) 162void carl9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len)
163{ 163{
164 struct carl9170_rsp *cmd = (void *) buf; 164 struct carl9170_rsp *cmd = buf;
165 struct ieee80211_vif *vif; 165 struct ieee80211_vif *vif;
166 166
167 if (carl9170_check_sequence(ar, cmd->hdr.seq)) 167 if (carl9170_check_sequence(ar, cmd->hdr.seq))
@@ -520,7 +520,7 @@ static u8 *carl9170_find_ie(u8 *data, unsigned int len, u8 ie)
520 */ 520 */
521static void carl9170_ps_beacon(struct ar9170 *ar, void *data, unsigned int len) 521static void carl9170_ps_beacon(struct ar9170 *ar, void *data, unsigned int len)
522{ 522{
523 struct ieee80211_hdr *hdr = (void *) data; 523 struct ieee80211_hdr *hdr = data;
524 struct ieee80211_tim_ie *tim_ie; 524 struct ieee80211_tim_ie *tim_ie;
525 u8 *tim; 525 u8 *tim;
526 u8 tim_len; 526 u8 tim_len;
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index d07c0301da6a..4a4e98f71807 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -2952,10 +2952,10 @@ static void send_association_request(struct atmel_private *priv, int is_reassoc)
2952 /* current AP address - only in reassoc frame */ 2952 /* current AP address - only in reassoc frame */
2953 if (is_reassoc) { 2953 if (is_reassoc) {
2954 memcpy(body.ap, priv->CurrentBSSID, 6); 2954 memcpy(body.ap, priv->CurrentBSSID, 6);
2955 ssid_el_p = (u8 *)&body.ssid_el_id; 2955 ssid_el_p = &body.ssid_el_id;
2956 bodysize = 18 + priv->SSID_size; 2956 bodysize = 18 + priv->SSID_size;
2957 } else { 2957 } else {
2958 ssid_el_p = (u8 *)&body.ap[0]; 2958 ssid_el_p = &body.ap[0];
2959 bodysize = 12 + priv->SSID_size; 2959 bodysize = 12 + priv->SSID_size;
2960 } 2960 }
2961 2961
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c
index f1f8bd09bd87..ff50cb4290e4 100644
--- a/drivers/net/wireless/b43legacy/dma.c
+++ b/drivers/net/wireless/b43legacy/dma.c
@@ -52,7 +52,7 @@ struct b43legacy_dmadesc32 *op32_idx2desc(struct b43legacy_dmaring *ring,
52 desc = ring->descbase; 52 desc = ring->descbase;
53 desc = &(desc[slot]); 53 desc = &(desc[slot]);
54 54
55 return (struct b43legacy_dmadesc32 *)desc; 55 return desc;
56} 56}
57 57
58static void op32_fill_descriptor(struct b43legacy_dmaring *ring, 58static void op32_fill_descriptor(struct b43legacy_dmaring *ring,
diff --git a/drivers/net/wireless/b43legacy/xmit.c b/drivers/net/wireless/b43legacy/xmit.c
index a8012f2749ee..b8ffea6f5c64 100644
--- a/drivers/net/wireless/b43legacy/xmit.c
+++ b/drivers/net/wireless/b43legacy/xmit.c
@@ -269,8 +269,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev,
269 b43legacy_generate_plcp_hdr((struct b43legacy_plcp_hdr4 *) 269 b43legacy_generate_plcp_hdr((struct b43legacy_plcp_hdr4 *)
270 (&txhdr->plcp), plcp_fragment_len, 270 (&txhdr->plcp), plcp_fragment_len,
271 rate); 271 rate);
272 b43legacy_generate_plcp_hdr((struct b43legacy_plcp_hdr4 *) 272 b43legacy_generate_plcp_hdr(&txhdr->plcp_fb, plcp_fragment_len,
273 (&txhdr->plcp_fb), plcp_fragment_len,
274 rate_fb->hw_value); 273 rate_fb->hw_value);
275 274
276 /* PHY TX Control word */ 275 /* PHY TX Control word */
@@ -340,8 +339,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev,
340 b43legacy_generate_plcp_hdr((struct b43legacy_plcp_hdr4 *) 339 b43legacy_generate_plcp_hdr((struct b43legacy_plcp_hdr4 *)
341 (&txhdr->rts_plcp), 340 (&txhdr->rts_plcp),
342 len, rts_rate); 341 len, rts_rate);
343 b43legacy_generate_plcp_hdr((struct b43legacy_plcp_hdr4 *) 342 b43legacy_generate_plcp_hdr(&txhdr->rts_plcp_fb,
344 (&txhdr->rts_plcp_fb),
345 len, rts_rate_fb); 343 len, rts_rate_fb);
346 hdr = (struct ieee80211_hdr *)(&txhdr->rts_frame); 344 hdr = (struct ieee80211_hdr *)(&txhdr->rts_frame);
347 txhdr->rts_dur_fb = hdr->duration_id; 345 txhdr->rts_dur_fb = hdr->duration_id;
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index 1dbf2be478c8..4deae28fc211 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -2502,7 +2502,7 @@ clkwait:
2502 int ret, i; 2502 int ret, i;
2503 2503
2504 ret = brcmf_sdcard_send_buf(bus->sdiodev, bus->sdiodev->sbwad, 2504 ret = brcmf_sdcard_send_buf(bus->sdiodev, bus->sdiodev->sbwad,
2505 SDIO_FUNC_2, F2SYNC, (u8 *) bus->ctrl_frame_buf, 2505 SDIO_FUNC_2, F2SYNC, bus->ctrl_frame_buf,
2506 (u32) bus->ctrl_frame_len); 2506 (u32) bus->ctrl_frame_len);
2507 2507
2508 if (ret < 0) { 2508 if (ret < 0) {
@@ -3327,7 +3327,7 @@ static int brcmf_sdbrcm_download_nvram(struct brcmf_sdio *bus)
3327 len = brcmf_sdbrcm_get_image(memblock, MEMBLOCK, bus); 3327 len = brcmf_sdbrcm_get_image(memblock, MEMBLOCK, bus);
3328 3328
3329 if (len > 0 && len < MEMBLOCK) { 3329 if (len > 0 && len < MEMBLOCK) {
3330 bufp = (char *)memblock; 3330 bufp = memblock;
3331 bufp[len] = 0; 3331 bufp[len] = 0;
3332 len = brcmf_process_nvram_vars(bufp, len); 3332 len = brcmf_process_nvram_vars(bufp, len);
3333 bufp += len; 3333 bufp += len;
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/dma.c b/drivers/net/wireless/brcm80211/brcmsmac/dma.c
index 11054ae9d4f6..7516639412ec 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/dma.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/dma.c
@@ -1433,7 +1433,7 @@ void dma_walk_packets(struct dma_pub *dmah, void (*callback_fnc)
1433 struct ieee80211_tx_info *tx_info; 1433 struct ieee80211_tx_info *tx_info;
1434 1434
1435 while (i != end) { 1435 while (i != end) {
1436 skb = (struct sk_buff *)di->txp[i]; 1436 skb = di->txp[i];
1437 if (skb != NULL) { 1437 if (skb != NULL) {
1438 tx_info = (struct ieee80211_tx_info *)skb->cb; 1438 tx_info = (struct ieee80211_tx_info *)skb->cb;
1439 (callback_fnc)(tx_info, arg_a); 1439 (callback_fnc)(tx_info, arg_a);
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 19db4052c44c..e67556780a31 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -8318,7 +8318,7 @@ brcms_c_attach(struct brcms_info *wl, struct bcma_device *core, uint unit,
8318 struct brcms_pub *pub; 8318 struct brcms_pub *pub;
8319 8319
8320 /* allocate struct brcms_c_info state and its substructures */ 8320 /* allocate struct brcms_c_info state and its substructures */
8321 wlc = (struct brcms_c_info *) brcms_c_attach_malloc(unit, &err, 0); 8321 wlc = brcms_c_attach_malloc(unit, &err, 0);
8322 if (wlc == NULL) 8322 if (wlc == NULL)
8323 goto fail; 8323 goto fail;
8324 wlc->wiphy = wl->wiphy; 8324 wlc->wiphy = wl->wiphy;
diff --git a/drivers/net/wireless/hostap/hostap_proc.c b/drivers/net/wireless/hostap/hostap_proc.c
index 75ef8f04aabe..dc447c1b5abe 100644
--- a/drivers/net/wireless/hostap/hostap_proc.c
+++ b/drivers/net/wireless/hostap/hostap_proc.c
@@ -58,8 +58,7 @@ static int prism2_stats_proc_read(char *page, char **start, off_t off,
58{ 58{
59 char *p = page; 59 char *p = page;
60 local_info_t *local = (local_info_t *) data; 60 local_info_t *local = (local_info_t *) data;
61 struct comm_tallies_sums *sums = (struct comm_tallies_sums *) 61 struct comm_tallies_sums *sums = &local->comm_tallies;
62 &local->comm_tallies;
63 62
64 if (off != 0) { 63 if (off != 0) {
65 *eof = 1; 64 *eof = 1;
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 0036737fe8e3..afdec4a0d9a0 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -7069,9 +7069,7 @@ static int ipw_qos_activate(struct ipw_priv *priv,
7069 } 7069 }
7070 7070
7071 IPW_DEBUG_QOS("QoS sending IPW_CMD_QOS_PARAMETERS\n"); 7071 IPW_DEBUG_QOS("QoS sending IPW_CMD_QOS_PARAMETERS\n");
7072 err = ipw_send_qos_params_command(priv, 7072 err = ipw_send_qos_params_command(priv, &qos_parameters[0]);
7073 (struct libipw_qos_parameters *)
7074 &(qos_parameters[0]));
7075 if (err) 7073 if (err)
7076 IPW_DEBUG_QOS("QoS IPW_CMD_QOS_PARAMETERS failed\n"); 7074 IPW_DEBUG_QOS("QoS IPW_CMD_QOS_PARAMETERS failed\n");
7077 7075
diff --git a/drivers/net/wireless/iwlwifi/iwl-testmode.c b/drivers/net/wireless/iwlwifi/iwl-testmode.c
index 060aac3e22f1..492e64fb9f3d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-testmode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-testmode.c
@@ -170,7 +170,7 @@ static void iwl_testmode_ucode_rx_pkt(struct iwl_priv *priv,
170 void *data; 170 void *data;
171 int length; 171 int length;
172 172
173 data = (void *)rxb_addr(rxb); 173 data = rxb_addr(rxb);
174 length = get_event_length(rxb); 174 length = get_event_length(rxb);
175 175
176 if (!data || length == 0) 176 if (!data || length == 0)
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
index ec6fb395b84d..b849528d48dc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
@@ -1354,7 +1354,7 @@ static int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb,
1354 DMA_BIDIRECTIONAL); 1354 DMA_BIDIRECTIONAL);
1355 1355
1356 trace_iwlwifi_dev_tx(trans->dev, 1356 trace_iwlwifi_dev_tx(trans->dev,
1357 &((struct iwl_tfd *)txq->tfds)[txq->q.write_ptr], 1357 &txq->tfds[txq->q.write_ptr],
1358 sizeof(struct iwl_tfd), 1358 sizeof(struct iwl_tfd),
1359 &dev_cmd->hdr, firstlen, 1359 &dev_cmd->hdr, firstlen,
1360 skb->data + hdr_len, secondlen); 1360 skb->data + hdr_len, secondlen);
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index a06cc283e23d..668dd27616a0 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -483,7 +483,7 @@ static ssize_t lbs_rdmac_write(struct file *file,
483 res = -EFAULT; 483 res = -EFAULT;
484 goto out_unlock; 484 goto out_unlock;
485 } 485 }
486 priv->mac_offset = simple_strtoul((char *)buf, NULL, 16); 486 priv->mac_offset = simple_strtoul(buf, NULL, 16);
487 res = count; 487 res = count;
488out_unlock: 488out_unlock:
489 free_page(addr); 489 free_page(addr);
@@ -565,7 +565,7 @@ static ssize_t lbs_rdbbp_write(struct file *file,
565 res = -EFAULT; 565 res = -EFAULT;
566 goto out_unlock; 566 goto out_unlock;
567 } 567 }
568 priv->bbp_offset = simple_strtoul((char *)buf, NULL, 16); 568 priv->bbp_offset = simple_strtoul(buf, NULL, 16);
569 res = count; 569 res = count;
570out_unlock: 570out_unlock:
571 free_page(addr); 571 free_page(addr);
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index cd3b0d400618..64b7dc5de126 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -302,7 +302,7 @@ error:
302static void if_usb_disconnect(struct usb_interface *intf) 302static void if_usb_disconnect(struct usb_interface *intf)
303{ 303{
304 struct if_usb_card *cardp = usb_get_intfdata(intf); 304 struct if_usb_card *cardp = usb_get_intfdata(intf);
305 struct lbs_private *priv = (struct lbs_private *) cardp->priv; 305 struct lbs_private *priv = cardp->priv;
306 306
307 lbs_deb_enter(LBS_DEB_MAIN); 307 lbs_deb_enter(LBS_DEB_MAIN);
308 308
diff --git a/drivers/net/wireless/libertas_tf/if_usb.c b/drivers/net/wireless/libertas_tf/if_usb.c
index 19a5a92dd779..d576dd6665d3 100644
--- a/drivers/net/wireless/libertas_tf/if_usb.c
+++ b/drivers/net/wireless/libertas_tf/if_usb.c
@@ -253,7 +253,7 @@ lbtf_deb_leave(LBTF_DEB_MAIN);
253static void if_usb_disconnect(struct usb_interface *intf) 253static void if_usb_disconnect(struct usb_interface *intf)
254{ 254{
255 struct if_usb_card *cardp = usb_get_intfdata(intf); 255 struct if_usb_card *cardp = usb_get_intfdata(intf);
256 struct lbtf_private *priv = (struct lbtf_private *) cardp->priv; 256 struct lbtf_private *priv = cardp->priv;
257 257
258 lbtf_deb_enter(LBTF_DEB_MAIN); 258 lbtf_deb_enter(LBTF_DEB_MAIN);
259 259
diff --git a/drivers/net/wireless/mwifiex/11n.c b/drivers/net/wireless/mwifiex/11n.c
index fe8ebfebcc0e..e535c937628b 100644
--- a/drivers/net/wireless/mwifiex/11n.c
+++ b/drivers/net/wireless/mwifiex/11n.c
@@ -101,8 +101,7 @@ int mwifiex_ret_11n_delba(struct mwifiex_private *priv,
101{ 101{
102 int tid; 102 int tid;
103 struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl; 103 struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl;
104 struct host_cmd_ds_11n_delba *del_ba = 104 struct host_cmd_ds_11n_delba *del_ba = &resp->params.del_ba;
105 (struct host_cmd_ds_11n_delba *) &resp->params.del_ba;
106 uint16_t del_ba_param_set = le16_to_cpu(del_ba->del_ba_param_set); 105 uint16_t del_ba_param_set = le16_to_cpu(del_ba->del_ba_param_set);
107 106
108 tid = del_ba_param_set >> DELBA_TID_POS; 107 tid = del_ba_param_set >> DELBA_TID_POS;
@@ -147,8 +146,7 @@ int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv,
147 struct host_cmd_ds_command *resp) 146 struct host_cmd_ds_command *resp)
148{ 147{
149 int tid; 148 int tid;
150 struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = 149 struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = &resp->params.add_ba_rsp;
151 (struct host_cmd_ds_11n_addba_rsp *) &resp->params.add_ba_rsp;
152 struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl; 150 struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl;
153 151
154 add_ba_rsp->ssn = cpu_to_le16((le16_to_cpu(add_ba_rsp->ssn)) 152 add_ba_rsp->ssn = cpu_to_le16((le16_to_cpu(add_ba_rsp->ssn))
@@ -412,7 +410,7 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
412 410
413 memcpy((u8 *) bss_co_2040 + 411 memcpy((u8 *) bss_co_2040 +
414 sizeof(struct mwifiex_ie_types_header), 412 sizeof(struct mwifiex_ie_types_header),
415 (u8 *) bss_desc->bcn_bss_co_2040 + 413 bss_desc->bcn_bss_co_2040 +
416 sizeof(struct ieee_types_header), 414 sizeof(struct ieee_types_header),
417 le16_to_cpu(bss_co_2040->header.len)); 415 le16_to_cpu(bss_co_2040->header.len));
418 416
@@ -426,10 +424,8 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
426 ext_cap->header.type = cpu_to_le16(WLAN_EID_EXT_CAPABILITY); 424 ext_cap->header.type = cpu_to_le16(WLAN_EID_EXT_CAPABILITY);
427 ext_cap->header.len = cpu_to_le16(sizeof(ext_cap->ext_cap)); 425 ext_cap->header.len = cpu_to_le16(sizeof(ext_cap->ext_cap));
428 426
429 memcpy((u8 *) ext_cap + 427 memcpy((u8 *)ext_cap + sizeof(struct mwifiex_ie_types_header),
430 sizeof(struct mwifiex_ie_types_header), 428 bss_desc->bcn_ext_cap + sizeof(struct ieee_types_header),
431 (u8 *) bss_desc->bcn_ext_cap +
432 sizeof(struct ieee_types_header),
433 le16_to_cpu(ext_cap->header.len)); 429 le16_to_cpu(ext_cap->header.len));
434 430
435 *buffer += sizeof(struct mwifiex_ie_types_extcap); 431 *buffer += sizeof(struct mwifiex_ie_types_extcap);
diff --git a/drivers/net/wireless/mwifiex/11n.h b/drivers/net/wireless/mwifiex/11n.h
index 77646d777dce..28366e9211fb 100644
--- a/drivers/net/wireless/mwifiex/11n.h
+++ b/drivers/net/wireless/mwifiex/11n.h
@@ -105,8 +105,7 @@ static inline u8 mwifiex_space_avail_for_new_ba_stream(
105 priv = adapter->priv[i]; 105 priv = adapter->priv[i];
106 if (priv) 106 if (priv)
107 ba_stream_num += mwifiex_wmm_list_len( 107 ba_stream_num += mwifiex_wmm_list_len(
108 (struct list_head *) 108 &priv->tx_ba_stream_tbl_ptr);
109 &priv->tx_ba_stream_tbl_ptr);
110 } 109 }
111 110
112 return ((ba_stream_num < 111 return ((ba_stream_num <
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.c b/drivers/net/wireless/mwifiex/11n_rxreorder.c
index 9c44088054dd..89f7c570cd2e 100644
--- a/drivers/net/wireless/mwifiex/11n_rxreorder.c
+++ b/drivers/net/wireless/mwifiex/11n_rxreorder.c
@@ -296,9 +296,7 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
296 */ 296 */
297int mwifiex_cmd_11n_addba_req(struct host_cmd_ds_command *cmd, void *data_buf) 297int mwifiex_cmd_11n_addba_req(struct host_cmd_ds_command *cmd, void *data_buf)
298{ 298{
299 struct host_cmd_ds_11n_addba_req *add_ba_req = 299 struct host_cmd_ds_11n_addba_req *add_ba_req = &cmd->params.add_ba_req;
300 (struct host_cmd_ds_11n_addba_req *)
301 &cmd->params.add_ba_req;
302 300
303 cmd->command = cpu_to_le16(HostCmd_CMD_11N_ADDBA_REQ); 301 cmd->command = cpu_to_le16(HostCmd_CMD_11N_ADDBA_REQ);
304 cmd->size = cpu_to_le16(sizeof(*add_ba_req) + S_DS_GEN); 302 cmd->size = cpu_to_le16(sizeof(*add_ba_req) + S_DS_GEN);
@@ -320,9 +318,7 @@ int mwifiex_cmd_11n_addba_rsp_gen(struct mwifiex_private *priv,
320 struct host_cmd_ds_11n_addba_req 318 struct host_cmd_ds_11n_addba_req
321 *cmd_addba_req) 319 *cmd_addba_req)
322{ 320{
323 struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = 321 struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = &cmd->params.add_ba_rsp;
324 (struct host_cmd_ds_11n_addba_rsp *)
325 &cmd->params.add_ba_rsp;
326 u8 tid; 322 u8 tid;
327 int win_size; 323 int win_size;
328 uint16_t block_ack_param_set; 324 uint16_t block_ack_param_set;
@@ -367,8 +363,7 @@ int mwifiex_cmd_11n_addba_rsp_gen(struct mwifiex_private *priv,
367 */ 363 */
368int mwifiex_cmd_11n_delba(struct host_cmd_ds_command *cmd, void *data_buf) 364int mwifiex_cmd_11n_delba(struct host_cmd_ds_command *cmd, void *data_buf)
369{ 365{
370 struct host_cmd_ds_11n_delba *del_ba = (struct host_cmd_ds_11n_delba *) 366 struct host_cmd_ds_11n_delba *del_ba = &cmd->params.del_ba;
371 &cmd->params.del_ba;
372 367
373 cmd->command = cpu_to_le16(HostCmd_CMD_11N_DELBA); 368 cmd->command = cpu_to_le16(HostCmd_CMD_11N_DELBA);
374 cmd->size = cpu_to_le16(sizeof(*del_ba) + S_DS_GEN); 369 cmd->size = cpu_to_le16(sizeof(*del_ba) + S_DS_GEN);
@@ -398,8 +393,7 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv,
398 int start_win, end_win, win_size; 393 int start_win, end_win, win_size;
399 u16 pkt_index; 394 u16 pkt_index;
400 395
401 tbl = mwifiex_11n_get_rx_reorder_tbl((struct mwifiex_private *) priv, 396 tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid, ta);
402 tid, ta);
403 if (!tbl) { 397 if (!tbl) {
404 if (pkt_type != PKT_TYPE_BAR) 398 if (pkt_type != PKT_TYPE_BAR)
405 mwifiex_process_rx_packet(priv->adapter, payload); 399 mwifiex_process_rx_packet(priv->adapter, payload);
@@ -520,9 +514,7 @@ mwifiex_del_ba_tbl(struct mwifiex_private *priv, int tid, u8 *peer_mac,
520int mwifiex_ret_11n_addba_resp(struct mwifiex_private *priv, 514int mwifiex_ret_11n_addba_resp(struct mwifiex_private *priv,
521 struct host_cmd_ds_command *resp) 515 struct host_cmd_ds_command *resp)
522{ 516{
523 struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = 517 struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = &resp->params.add_ba_rsp;
524 (struct host_cmd_ds_11n_addba_rsp *)
525 &resp->params.add_ba_rsp;
526 int tid, win_size; 518 int tid, win_size;
527 struct mwifiex_rx_reorder_tbl *tbl; 519 struct mwifiex_rx_reorder_tbl *tbl;
528 uint16_t block_ack_param_set; 520 uint16_t block_ack_param_set;
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 87671446e24b..42c1af943111 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1703,7 +1703,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
1703 wdev_priv = wiphy_priv(wiphy); 1703 wdev_priv = wiphy_priv(wiphy);
1704 *(unsigned long *)wdev_priv = (unsigned long)adapter; 1704 *(unsigned long *)wdev_priv = (unsigned long)adapter;
1705 1705
1706 set_wiphy_dev(wiphy, (struct device *)priv->adapter->dev); 1706 set_wiphy_dev(wiphy, priv->adapter->dev);
1707 1707
1708 ret = wiphy_register(wiphy); 1708 ret = wiphy_register(wiphy);
1709 if (ret < 0) { 1709 if (ret < 0) {
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index d6b4fb04011f..82e63cee1e97 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -1349,22 +1349,16 @@ static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac)
1349{ 1349{
1350 u8 mac_address[ETH_ALEN]; 1350 u8 mac_address[ETH_ALEN];
1351 int ret; 1351 int ret;
1352 u8 zero_mac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 };
1353 1352
1354 if (mac) { 1353 if (!mac || is_zero_ether_addr(mac))
1355 if (!memcmp(mac, zero_mac, sizeof(zero_mac))) 1354 memcpy(mac_address,
1356 memcpy((u8 *) &mac_address, 1355 priv->curr_bss_params.bss_descriptor.mac_address,
1357 (u8 *) &priv->curr_bss_params.bss_descriptor. 1356 ETH_ALEN);
1358 mac_address, ETH_ALEN); 1357 else
1359 else 1358 memcpy(mac_address, mac, ETH_ALEN);
1360 memcpy((u8 *) &mac_address, (u8 *) mac, ETH_ALEN);
1361 } else {
1362 memcpy((u8 *) &mac_address, (u8 *) &priv->curr_bss_params.
1363 bss_descriptor.mac_address, ETH_ALEN);
1364 }
1365 1359
1366 ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_DEAUTHENTICATE, 1360 ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_DEAUTHENTICATE,
1367 HostCmd_ACT_GEN_SET, 0, &mac_address); 1361 HostCmd_ACT_GEN_SET, 0, mac_address);
1368 1362
1369 return ret; 1363 return ret;
1370} 1364}
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 74f045715723..8fa763fa629a 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1014,14 +1014,12 @@ mwifiex_ret_802_11_scan_get_tlv_ptrs(struct mwifiex_adapter *adapter,
1014 case TLV_TYPE_TSFTIMESTAMP: 1014 case TLV_TYPE_TSFTIMESTAMP:
1015 dev_dbg(adapter->dev, "info: SCAN_RESP: TSF " 1015 dev_dbg(adapter->dev, "info: SCAN_RESP: TSF "
1016 "timestamp TLV, len = %d\n", tlv_len); 1016 "timestamp TLV, len = %d\n", tlv_len);
1017 *tlv_data = (struct mwifiex_ie_types_data *) 1017 *tlv_data = current_tlv;
1018 current_tlv;
1019 break; 1018 break;
1020 case TLV_TYPE_CHANNELBANDLIST: 1019 case TLV_TYPE_CHANNELBANDLIST:
1021 dev_dbg(adapter->dev, "info: SCAN_RESP: channel" 1020 dev_dbg(adapter->dev, "info: SCAN_RESP: channel"
1022 " band list TLV, len = %d\n", tlv_len); 1021 " band list TLV, len = %d\n", tlv_len);
1023 *tlv_data = (struct mwifiex_ie_types_data *) 1022 *tlv_data = current_tlv;
1024 current_tlv;
1025 break; 1023 break;
1026 default: 1024 default:
1027 dev_err(adapter->dev, 1025 dev_err(adapter->dev,
@@ -1226,15 +1224,15 @@ int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
1226 bss_entry->beacon_buf); 1224 bss_entry->beacon_buf);
1227 break; 1225 break;
1228 case WLAN_EID_BSS_COEX_2040: 1226 case WLAN_EID_BSS_COEX_2040:
1229 bss_entry->bcn_bss_co_2040 = (u8 *) (current_ptr + 1227 bss_entry->bcn_bss_co_2040 = current_ptr +
1230 sizeof(struct ieee_types_header)); 1228 sizeof(struct ieee_types_header);
1231 bss_entry->bss_co_2040_offset = (u16) (current_ptr + 1229 bss_entry->bss_co_2040_offset = (u16) (current_ptr +
1232 sizeof(struct ieee_types_header) - 1230 sizeof(struct ieee_types_header) -
1233 bss_entry->beacon_buf); 1231 bss_entry->beacon_buf);
1234 break; 1232 break;
1235 case WLAN_EID_EXT_CAPABILITY: 1233 case WLAN_EID_EXT_CAPABILITY:
1236 bss_entry->bcn_ext_cap = (u8 *) (current_ptr + 1234 bss_entry->bcn_ext_cap = current_ptr +
1237 sizeof(struct ieee_types_header)); 1235 sizeof(struct ieee_types_header);
1238 bss_entry->ext_cap_offset = (u16) (current_ptr + 1236 bss_entry->ext_cap_offset = (u16) (current_ptr +
1239 sizeof(struct ieee_types_header) - 1237 sizeof(struct ieee_types_header) -
1240 bss_entry->beacon_buf); 1238 bss_entry->beacon_buf);
@@ -1683,8 +1681,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
1683 goto done; 1681 goto done;
1684 } 1682 }
1685 if (element_id == WLAN_EID_DS_PARAMS) { 1683 if (element_id == WLAN_EID_DS_PARAMS) {
1686 channel = *(u8 *) (current_ptr + 1684 channel = *(current_ptr + sizeof(struct ieee_types_header));
1687 sizeof(struct ieee_types_header));
1688 break; 1685 break;
1689 } 1686 }
1690 1687
@@ -2010,12 +2007,11 @@ mwifiex_save_curr_bcn(struct mwifiex_private *priv)
2010 2007
2011 if (curr_bss->bcn_bss_co_2040) 2008 if (curr_bss->bcn_bss_co_2040)
2012 curr_bss->bcn_bss_co_2040 = 2009 curr_bss->bcn_bss_co_2040 =
2013 (u8 *) (curr_bss->beacon_buf + 2010 (curr_bss->beacon_buf + curr_bss->bss_co_2040_offset);
2014 curr_bss->bss_co_2040_offset);
2015 2011
2016 if (curr_bss->bcn_ext_cap) 2012 if (curr_bss->bcn_ext_cap)
2017 curr_bss->bcn_ext_cap = (u8 *) (curr_bss->beacon_buf + 2013 curr_bss->bcn_ext_cap = curr_bss->beacon_buf +
2018 curr_bss->ext_cap_offset); 2014 curr_bss->ext_cap_offset;
2019} 2015}
2020 2016
2021/* 2017/*
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
index 40e025da6bc2..1ff1362d8cdf 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -793,8 +793,7 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
793 struct host_cmd_ds_mac_reg_access *mac_reg; 793 struct host_cmd_ds_mac_reg_access *mac_reg;
794 794
795 cmd->size = cpu_to_le16(sizeof(*mac_reg) + S_DS_GEN); 795 cmd->size = cpu_to_le16(sizeof(*mac_reg) + S_DS_GEN);
796 mac_reg = (struct host_cmd_ds_mac_reg_access *) &cmd-> 796 mac_reg = &cmd->params.mac_reg;
797 params.mac_reg;
798 mac_reg->action = cpu_to_le16(cmd_action); 797 mac_reg->action = cpu_to_le16(cmd_action);
799 mac_reg->offset = 798 mac_reg->offset =
800 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 799 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
@@ -806,8 +805,7 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
806 struct host_cmd_ds_bbp_reg_access *bbp_reg; 805 struct host_cmd_ds_bbp_reg_access *bbp_reg;
807 806
808 cmd->size = cpu_to_le16(sizeof(*bbp_reg) + S_DS_GEN); 807 cmd->size = cpu_to_le16(sizeof(*bbp_reg) + S_DS_GEN);
809 bbp_reg = (struct host_cmd_ds_bbp_reg_access *) 808 bbp_reg = &cmd->params.bbp_reg;
810 &cmd->params.bbp_reg;
811 bbp_reg->action = cpu_to_le16(cmd_action); 809 bbp_reg->action = cpu_to_le16(cmd_action);
812 bbp_reg->offset = 810 bbp_reg->offset =
813 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 811 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
@@ -819,8 +817,7 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
819 struct host_cmd_ds_rf_reg_access *rf_reg; 817 struct host_cmd_ds_rf_reg_access *rf_reg;
820 818
821 cmd->size = cpu_to_le16(sizeof(*rf_reg) + S_DS_GEN); 819 cmd->size = cpu_to_le16(sizeof(*rf_reg) + S_DS_GEN);
822 rf_reg = (struct host_cmd_ds_rf_reg_access *) 820 rf_reg = &cmd->params.rf_reg;
823 &cmd->params.rf_reg;
824 rf_reg->action = cpu_to_le16(cmd_action); 821 rf_reg->action = cpu_to_le16(cmd_action);
825 rf_reg->offset = cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 822 rf_reg->offset = cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
826 rf_reg->value = (u8) le32_to_cpu(reg_rw->value); 823 rf_reg->value = (u8) le32_to_cpu(reg_rw->value);
@@ -831,8 +828,7 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
831 struct host_cmd_ds_pmic_reg_access *pmic_reg; 828 struct host_cmd_ds_pmic_reg_access *pmic_reg;
832 829
833 cmd->size = cpu_to_le16(sizeof(*pmic_reg) + S_DS_GEN); 830 cmd->size = cpu_to_le16(sizeof(*pmic_reg) + S_DS_GEN);
834 pmic_reg = (struct host_cmd_ds_pmic_reg_access *) &cmd-> 831 pmic_reg = &cmd->params.pmic_reg;
835 params.pmic_reg;
836 pmic_reg->action = cpu_to_le16(cmd_action); 832 pmic_reg->action = cpu_to_le16(cmd_action);
837 pmic_reg->offset = 833 pmic_reg->offset =
838 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 834 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
@@ -844,8 +840,7 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
844 struct host_cmd_ds_rf_reg_access *cau_reg; 840 struct host_cmd_ds_rf_reg_access *cau_reg;
845 841
846 cmd->size = cpu_to_le16(sizeof(*cau_reg) + S_DS_GEN); 842 cmd->size = cpu_to_le16(sizeof(*cau_reg) + S_DS_GEN);
847 cau_reg = (struct host_cmd_ds_rf_reg_access *) 843 cau_reg = &cmd->params.rf_reg;
848 &cmd->params.rf_reg;
849 cau_reg->action = cpu_to_le16(cmd_action); 844 cau_reg->action = cpu_to_le16(cmd_action);
850 cau_reg->offset = 845 cau_reg->offset =
851 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 846 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
@@ -856,7 +851,6 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
856 { 851 {
857 struct mwifiex_ds_read_eeprom *rd_eeprom = data_buf; 852 struct mwifiex_ds_read_eeprom *rd_eeprom = data_buf;
858 struct host_cmd_ds_802_11_eeprom_access *cmd_eeprom = 853 struct host_cmd_ds_802_11_eeprom_access *cmd_eeprom =
859 (struct host_cmd_ds_802_11_eeprom_access *)
860 &cmd->params.eeprom; 854 &cmd->params.eeprom;
861 855
862 cmd->size = cpu_to_le16(sizeof(*cmd_eeprom) + S_DS_GEN); 856 cmd->size = cpu_to_le16(sizeof(*cmd_eeprom) + S_DS_GEN);
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c
index a79ed9bd9695..bd40541ebd5a 100644
--- a/drivers/net/wireless/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c
@@ -227,7 +227,7 @@ static int mwifiex_ret_get_log(struct mwifiex_private *priv,
227 struct mwifiex_ds_get_stats *stats) 227 struct mwifiex_ds_get_stats *stats)
228{ 228{
229 struct host_cmd_ds_802_11_get_log *get_log = 229 struct host_cmd_ds_802_11_get_log *get_log =
230 (struct host_cmd_ds_802_11_get_log *) &resp->params.get_log; 230 &resp->params.get_log;
231 231
232 if (stats) { 232 if (stats) {
233 stats->mcast_tx_frame = le32_to_cpu(get_log->mcast_tx_frame); 233 stats->mcast_tx_frame = le32_to_cpu(get_log->mcast_tx_frame);
@@ -282,7 +282,7 @@ static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv,
282 u32 i; 282 u32 i;
283 int ret = 0; 283 int ret = 0;
284 284
285 tlv_buf = (u8 *) ((u8 *) rate_cfg) + 285 tlv_buf = ((u8 *)rate_cfg) +
286 sizeof(struct host_cmd_ds_tx_rate_cfg); 286 sizeof(struct host_cmd_ds_tx_rate_cfg);
287 tlv_buf_len = *(u16 *) (tlv_buf + sizeof(u16)); 287 tlv_buf_len = *(u16 *) (tlv_buf + sizeof(u16));
288 288
@@ -679,39 +679,33 @@ static int mwifiex_ret_reg_access(u16 type, struct host_cmd_ds_command *resp,
679 eeprom = data_buf; 679 eeprom = data_buf;
680 switch (type) { 680 switch (type) {
681 case HostCmd_CMD_MAC_REG_ACCESS: 681 case HostCmd_CMD_MAC_REG_ACCESS:
682 r.mac = (struct host_cmd_ds_mac_reg_access *) 682 r.mac = &resp->params.mac_reg;
683 &resp->params.mac_reg;
684 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.mac->offset)); 683 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.mac->offset));
685 reg_rw->value = r.mac->value; 684 reg_rw->value = r.mac->value;
686 break; 685 break;
687 case HostCmd_CMD_BBP_REG_ACCESS: 686 case HostCmd_CMD_BBP_REG_ACCESS:
688 r.bbp = (struct host_cmd_ds_bbp_reg_access *) 687 r.bbp = &resp->params.bbp_reg;
689 &resp->params.bbp_reg;
690 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.bbp->offset)); 688 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.bbp->offset));
691 reg_rw->value = cpu_to_le32((u32) r.bbp->value); 689 reg_rw->value = cpu_to_le32((u32) r.bbp->value);
692 break; 690 break;
693 691
694 case HostCmd_CMD_RF_REG_ACCESS: 692 case HostCmd_CMD_RF_REG_ACCESS:
695 r.rf = (struct host_cmd_ds_rf_reg_access *) 693 r.rf = &resp->params.rf_reg;
696 &resp->params.rf_reg;
697 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset)); 694 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset));
698 reg_rw->value = cpu_to_le32((u32) r.bbp->value); 695 reg_rw->value = cpu_to_le32((u32) r.bbp->value);
699 break; 696 break;
700 case HostCmd_CMD_PMIC_REG_ACCESS: 697 case HostCmd_CMD_PMIC_REG_ACCESS:
701 r.pmic = (struct host_cmd_ds_pmic_reg_access *) 698 r.pmic = &resp->params.pmic_reg;
702 &resp->params.pmic_reg;
703 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.pmic->offset)); 699 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.pmic->offset));
704 reg_rw->value = cpu_to_le32((u32) r.pmic->value); 700 reg_rw->value = cpu_to_le32((u32) r.pmic->value);
705 break; 701 break;
706 case HostCmd_CMD_CAU_REG_ACCESS: 702 case HostCmd_CMD_CAU_REG_ACCESS:
707 r.rf = (struct host_cmd_ds_rf_reg_access *) 703 r.rf = &resp->params.rf_reg;
708 &resp->params.rf_reg;
709 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset)); 704 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset));
710 reg_rw->value = cpu_to_le32((u32) r.rf->value); 705 reg_rw->value = cpu_to_le32((u32) r.rf->value);
711 break; 706 break;
712 case HostCmd_CMD_802_11_EEPROM_ACCESS: 707 case HostCmd_CMD_802_11_EEPROM_ACCESS:
713 r.eeprom = (struct host_cmd_ds_802_11_eeprom_access *) 708 r.eeprom = &resp->params.eeprom;
714 &resp->params.eeprom;
715 pr_debug("info: EEPROM read len=%x\n", r.eeprom->byte_count); 709 pr_debug("info: EEPROM read len=%x\n", r.eeprom->byte_count);
716 if (le16_to_cpu(eeprom->byte_count) < 710 if (le16_to_cpu(eeprom->byte_count) <
717 le16_to_cpu(r.eeprom->byte_count)) { 711 le16_to_cpu(r.eeprom->byte_count)) {
@@ -787,7 +781,7 @@ static int mwifiex_ret_subsc_evt(struct mwifiex_private *priv,
787 struct mwifiex_ds_misc_subsc_evt *sub_event) 781 struct mwifiex_ds_misc_subsc_evt *sub_event)
788{ 782{
789 struct host_cmd_ds_802_11_subsc_evt *cmd_sub_event = 783 struct host_cmd_ds_802_11_subsc_evt *cmd_sub_event =
790 (struct host_cmd_ds_802_11_subsc_evt *)&resp->params.subsc_evt; 784 &resp->params.subsc_evt;
791 785
792 /* For every subscribe event command (Get/Set/Clear), FW reports the 786 /* For every subscribe event command (Get/Set/Clear), FW reports the
793 * current set of subscribed events*/ 787 * current set of subscribed events*/
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c
index 4ace5a3dcd23..e8b27c305367 100644
--- a/drivers/net/wireless/mwifiex/sta_event.c
+++ b/drivers/net/wireless/mwifiex/sta_event.c
@@ -422,7 +422,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
422 422
423 if (len != -1) { 423 if (len != -1) {
424 sinfo.filled = STATION_INFO_ASSOC_REQ_IES; 424 sinfo.filled = STATION_INFO_ASSOC_REQ_IES;
425 sinfo.assoc_req_ies = (u8 *)&event->data[len]; 425 sinfo.assoc_req_ies = &event->data[len];
426 len = (u8 *)sinfo.assoc_req_ies - 426 len = (u8 *)sinfo.assoc_req_ies -
427 (u8 *)&event->frame_control; 427 (u8 *)&event->frame_control;
428 sinfo.assoc_req_ies_len = 428 sinfo.assoc_req_ies_len =
diff --git a/drivers/net/wireless/p54/eeprom.c b/drivers/net/wireless/p54/eeprom.c
index fa8ce5104781..636daf2860cc 100644
--- a/drivers/net/wireless/p54/eeprom.c
+++ b/drivers/net/wireless/p54/eeprom.c
@@ -905,7 +905,7 @@ int p54_read_eeprom(struct ieee80211_hw *dev)
905 905
906 while (eeprom_size) { 906 while (eeprom_size) {
907 blocksize = min(eeprom_size, maxblocksize); 907 blocksize = min(eeprom_size, maxblocksize);
908 ret = p54_download_eeprom(priv, (void *) (eeprom + offset), 908 ret = p54_download_eeprom(priv, eeprom + offset,
909 offset, blocksize); 909 offset, blocksize);
910 if (unlikely(ret)) 910 if (unlikely(ret))
911 goto free; 911 goto free;
diff --git a/drivers/net/wireless/p54/fwio.c b/drivers/net/wireless/p54/fwio.c
index 18e82b31afa6..9ba85106eec0 100644
--- a/drivers/net/wireless/p54/fwio.c
+++ b/drivers/net/wireless/p54/fwio.c
@@ -478,7 +478,7 @@ int p54_scan(struct p54_common *priv, u16 mode, u16 dwell)
478 478
479 if (priv->rxhw == PDR_SYNTH_FRONTEND_LONGBOW) { 479 if (priv->rxhw == PDR_SYNTH_FRONTEND_LONGBOW) {
480 memcpy(&body->longbow.curve_data, 480 memcpy(&body->longbow.curve_data,
481 (void *) entry + sizeof(__le16), 481 entry + sizeof(__le16),
482 priv->curve_data->entry_size); 482 priv->curve_data->entry_size);
483 } else { 483 } else {
484 struct p54_scan_body *chan = &body->normal; 484 struct p54_scan_body *chan = &body->normal;
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c
index 266d45bf86f5..799e148d0370 100644
--- a/drivers/net/wireless/prism54/islpci_eth.c
+++ b/drivers/net/wireless/prism54/islpci_eth.c
@@ -455,7 +455,7 @@ islpci_eth_receive(islpci_private *priv)
455 "Error mapping DMA address\n"); 455 "Error mapping DMA address\n");
456 456
457 /* free the skbuf structure before aborting */ 457 /* free the skbuf structure before aborting */
458 dev_kfree_skb_irq((struct sk_buff *) skb); 458 dev_kfree_skb_irq(skb);
459 skb = NULL; 459 skb = NULL;
460 break; 460 break;
461 } 461 }
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 86a738bf591c..598ca1cafb95 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -1849,7 +1849,7 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
1849 pr_debug("ray_cs: interrupt for *dev=%p\n", dev); 1849 pr_debug("ray_cs: interrupt for *dev=%p\n", dev);
1850 1850
1851 local = netdev_priv(dev); 1851 local = netdev_priv(dev);
1852 link = (struct pcmcia_device *)local->finder; 1852 link = local->finder;
1853 if (!pcmcia_dev_present(link)) { 1853 if (!pcmcia_dev_present(link)) {
1854 pr_debug( 1854 pr_debug(
1855 "ray_cs interrupt from device not present or suspended.\n"); 1855 "ray_cs interrupt from device not present or suspended.\n");
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;
diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c
index 6893bc207994..3fb595546538 100644
--- a/drivers/net/wireless/ti/wlcore/tx.c
+++ b/drivers/net/wireless/ti/wlcore/tx.c
@@ -871,8 +871,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
871/* Called upon reception of a TX complete interrupt */ 871/* Called upon reception of a TX complete interrupt */
872void wl1271_tx_complete(struct wl1271 *wl) 872void wl1271_tx_complete(struct wl1271 *wl)
873{ 873{
874 struct wl1271_acx_mem_map *memmap = 874 struct wl1271_acx_mem_map *memmap = wl->target_mem_map;
875 (struct wl1271_acx_mem_map *)wl->target_mem_map;
876 u32 count, fw_counter; 875 u32 count, fw_counter;
877 u32 i; 876 u32 i;
878 877
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.h b/drivers/net/wireless/zd1211rw/zd_chip.h
index 117c4123943c..7ab922209b25 100644
--- a/drivers/net/wireless/zd1211rw/zd_chip.h
+++ b/drivers/net/wireless/zd1211rw/zd_chip.h
@@ -827,7 +827,7 @@ int zd_ioread32v_locked(struct zd_chip *chip, u32 *values,
827static inline int zd_ioread32_locked(struct zd_chip *chip, u32 *value, 827static inline int zd_ioread32_locked(struct zd_chip *chip, u32 *value,
828 const zd_addr_t addr) 828 const zd_addr_t addr)
829{ 829{
830 return zd_ioread32v_locked(chip, value, (const zd_addr_t *)&addr, 1); 830 return zd_ioread32v_locked(chip, value, &addr, 1);
831} 831}
832 832
833static inline int zd_iowrite16_locked(struct zd_chip *chip, u16 value, 833static inline int zd_iowrite16_locked(struct zd_chip *chip, u16 value,
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.h b/drivers/net/wireless/zd1211rw/zd_usb.h
index 99193b456a79..45e3bb28a01c 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.h
+++ b/drivers/net/wireless/zd1211rw/zd_usb.h
@@ -274,7 +274,7 @@ int zd_usb_ioread16v(struct zd_usb *usb, u16 *values,
274static inline int zd_usb_ioread16(struct zd_usb *usb, u16 *value, 274static inline int zd_usb_ioread16(struct zd_usb *usb, u16 *value,
275 const zd_addr_t addr) 275 const zd_addr_t addr)
276{ 276{
277 return zd_usb_ioread16v(usb, value, (const zd_addr_t *)&addr, 1); 277 return zd_usb_ioread16v(usb, value, &addr, 1);
278} 278}
279 279
280void zd_usb_iowrite16v_async_start(struct zd_usb *usb); 280void zd_usb_iowrite16v_async_start(struct zd_usb *usb);