Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joe Perches and committed by
David S. Miller
2c208890 64699336

+198 -247
+1 -2
drivers/net/wireless/adm8211.c
··· 1738 1738 return -ENOMEM; 1739 1739 } 1740 1740 1741 - priv->tx_ring = (struct adm8211_desc *)(priv->rx_ring + 1742 - priv->rx_ring_size); 1741 + priv->tx_ring = priv->rx_ring + priv->rx_ring_size; 1743 1742 priv->tx_ring_dma = priv->rx_ring_dma + 1744 1743 sizeof(struct adm8211_desc) * priv->rx_ring_size; 1745 1744
+2 -2
drivers/net/wireless/airo.c
··· 1997 1997 * ------------------------------------------------ 1998 1998 */ 1999 1999 2000 - memcpy((char *)ai->txfids[0].virtual_host_addr, 2000 + memcpy(ai->txfids[0].virtual_host_addr, 2001 2001 (char *)&wifictlhdr8023, sizeof(wifictlhdr8023)); 2002 2002 2003 2003 payloadLen = (__le16 *)(ai->txfids[0].virtual_host_addr + ··· 4212 4212 airo_print_err(ai->dev->name, "%s: len=%d", __func__, len); 4213 4213 rc = -1; 4214 4214 } else { 4215 - memcpy((char *)ai->config_desc.virtual_host_addr, 4215 + memcpy(ai->config_desc.virtual_host_addr, 4216 4216 pBuf, len); 4217 4217 4218 4218 rc = issuecommand(ai, &cmd, &rsp);
+2 -2
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
··· 3178 3178 mdata_size, length); 3179 3179 return -1; 3180 3180 } 3181 - memcpy(mptr, (u8 *) (word + COMP_HDR_LEN), length); 3181 + memcpy(mptr, word + COMP_HDR_LEN, length); 3182 3182 ath_dbg(common, EEPROM, 3183 3183 "restored eeprom %d: uncompressed, length %d\n", 3184 3184 it, length); ··· 3199 3199 "restore eeprom %d: block, reference %d, length %d\n", 3200 3200 it, reference, length); 3201 3201 ar9300_uncompress_block(ah, mptr, mdata_size, 3202 - (u8 *) (word + COMP_HDR_LEN), length); 3202 + (word + COMP_HDR_LEN), length); 3203 3203 break; 3204 3204 default: 3205 3205 ath_dbg(common, EEPROM, "unknown compression code %d\n", code);
+1 -2
drivers/net/wireless/ath/ath9k/eeprom_4k.c
··· 188 188 { 189 189 #define EEPROM_4K_SIZE (sizeof(struct ar5416_eeprom_4k) / sizeof(u16)) 190 190 struct ath_common *common = ath9k_hw_common(ah); 191 - struct ar5416_eeprom_4k *eep = 192 - (struct ar5416_eeprom_4k *) &ah->eeprom.map4k; 191 + struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k; 193 192 u16 *eepdata, temp, magic, magic2; 194 193 u32 sum = 0, el; 195 194 bool need_swap = false;
+1 -2
drivers/net/wireless/ath/ath9k/eeprom_def.c
··· 264 264 265 265 static int ath9k_hw_def_check_eeprom(struct ath_hw *ah) 266 266 { 267 - struct ar5416_eeprom_def *eep = 268 - (struct ar5416_eeprom_def *) &ah->eeprom.def; 267 + struct ar5416_eeprom_def *eep = &ah->eeprom.def; 269 268 struct ath_common *common = ath9k_hw_common(ah); 270 269 u16 *eepdata, temp, magic, magic2; 271 270 u32 sum = 0, el;
+1 -1
drivers/net/wireless/ath/carl9170/cmd.c
··· 138 138 if (!cmd) 139 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 142 return err; 143 143 } 144 144
+2 -2
drivers/net/wireless/ath/carl9170/rx.c
··· 161 161 162 162 void 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 165 struct ieee80211_vif *vif; 166 166 167 167 if (carl9170_check_sequence(ar, cmd->hdr.seq)) ··· 520 520 */ 521 521 static 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 524 struct ieee80211_tim_ie *tim_ie; 525 525 u8 *tim; 526 526 u8 tim_len;
+2 -2
drivers/net/wireless/atmel.c
··· 2952 2952 /* current AP address - only in reassoc frame */ 2953 2953 if (is_reassoc) { 2954 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 2956 bodysize = 18 + priv->SSID_size; 2957 2957 } else { 2958 - ssid_el_p = (u8 *)&body.ap[0]; 2958 + ssid_el_p = &body.ap[0]; 2959 2959 bodysize = 12 + priv->SSID_size; 2960 2960 } 2961 2961
+1 -1
drivers/net/wireless/b43legacy/dma.c
··· 52 52 desc = ring->descbase; 53 53 desc = &(desc[slot]); 54 54 55 - return (struct b43legacy_dmadesc32 *)desc; 55 + return desc; 56 56 } 57 57 58 58 static void op32_fill_descriptor(struct b43legacy_dmaring *ring,
+2 -4
drivers/net/wireless/b43legacy/xmit.c
··· 269 269 b43legacy_generate_plcp_hdr((struct b43legacy_plcp_hdr4 *) 270 270 (&txhdr->plcp), plcp_fragment_len, 271 271 rate); 272 - b43legacy_generate_plcp_hdr((struct b43legacy_plcp_hdr4 *) 273 - (&txhdr->plcp_fb), plcp_fragment_len, 272 + b43legacy_generate_plcp_hdr(&txhdr->plcp_fb, plcp_fragment_len, 274 273 rate_fb->hw_value); 275 274 276 275 /* PHY TX Control word */ ··· 339 340 b43legacy_generate_plcp_hdr((struct b43legacy_plcp_hdr4 *) 340 341 (&txhdr->rts_plcp), 341 342 len, rts_rate); 342 - b43legacy_generate_plcp_hdr((struct b43legacy_plcp_hdr4 *) 343 - (&txhdr->rts_plcp_fb), 343 + b43legacy_generate_plcp_hdr(&txhdr->rts_plcp_fb, 344 344 len, rts_rate_fb); 345 345 hdr = (struct ieee80211_hdr *)(&txhdr->rts_frame); 346 346 txhdr->rts_dur_fb = hdr->duration_id;
+2 -2
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
··· 2502 2502 int ret, i; 2503 2503 2504 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 2506 (u32) bus->ctrl_frame_len); 2507 2507 2508 2508 if (ret < 0) { ··· 3327 3327 len = brcmf_sdbrcm_get_image(memblock, MEMBLOCK, bus); 3328 3328 3329 3329 if (len > 0 && len < MEMBLOCK) { 3330 - bufp = (char *)memblock; 3330 + bufp = memblock; 3331 3331 bufp[len] = 0; 3332 3332 len = brcmf_process_nvram_vars(bufp, len); 3333 3333 bufp += len;
+1 -1
drivers/net/wireless/brcm80211/brcmsmac/dma.c
··· 1433 1433 struct ieee80211_tx_info *tx_info; 1434 1434 1435 1435 while (i != end) { 1436 - skb = (struct sk_buff *)di->txp[i]; 1436 + skb = di->txp[i]; 1437 1437 if (skb != NULL) { 1438 1438 tx_info = (struct ieee80211_tx_info *)skb->cb; 1439 1439 (callback_fnc)(tx_info, arg_a);
+1 -1
drivers/net/wireless/brcm80211/brcmsmac/main.c
··· 8318 8318 struct brcms_pub *pub; 8319 8319 8320 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 8322 if (wlc == NULL) 8323 8323 goto fail; 8324 8324 wlc->wiphy = wl->wiphy;
+1 -2
drivers/net/wireless/hostap/hostap_proc.c
··· 58 58 { 59 59 char *p = page; 60 60 local_info_t *local = (local_info_t *) data; 61 - struct comm_tallies_sums *sums = (struct comm_tallies_sums *) 62 - &local->comm_tallies; 61 + struct comm_tallies_sums *sums = &local->comm_tallies; 63 62 64 63 if (off != 0) { 65 64 *eof = 1;
+1 -3
drivers/net/wireless/ipw2x00/ipw2200.c
··· 7069 7069 } 7070 7070 7071 7071 IPW_DEBUG_QOS("QoS sending IPW_CMD_QOS_PARAMETERS\n"); 7072 - err = ipw_send_qos_params_command(priv, 7073 - (struct libipw_qos_parameters *) 7074 - &(qos_parameters[0])); 7072 + err = ipw_send_qos_params_command(priv, &qos_parameters[0]); 7075 7073 if (err) 7076 7074 IPW_DEBUG_QOS("QoS IPW_CMD_QOS_PARAMETERS failed\n"); 7077 7075
+1 -1
drivers/net/wireless/iwlwifi/iwl-testmode.c
··· 170 170 void *data; 171 171 int length; 172 172 173 - data = (void *)rxb_addr(rxb); 173 + data = rxb_addr(rxb); 174 174 length = get_event_length(rxb); 175 175 176 176 if (!data || length == 0)
+1 -1
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
··· 1354 1354 DMA_BIDIRECTIONAL); 1355 1355 1356 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 1358 sizeof(struct iwl_tfd), 1359 1359 &dev_cmd->hdr, firstlen, 1360 1360 skb->data + hdr_len, secondlen);
+2 -2
drivers/net/wireless/libertas/debugfs.c
··· 483 483 res = -EFAULT; 484 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 487 res = count; 488 488 out_unlock: 489 489 free_page(addr); ··· 565 565 res = -EFAULT; 566 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 569 res = count; 570 570 out_unlock: 571 571 free_page(addr);
+1 -1
drivers/net/wireless/libertas/if_usb.c
··· 302 302 static void if_usb_disconnect(struct usb_interface *intf) 303 303 { 304 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 307 lbs_deb_enter(LBS_DEB_MAIN); 308 308
+1 -1
drivers/net/wireless/libertas_tf/if_usb.c
··· 253 253 static void if_usb_disconnect(struct usb_interface *intf) 254 254 { 255 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 258 lbtf_deb_enter(LBTF_DEB_MAIN); 259 259
+5 -9
drivers/net/wireless/mwifiex/11n.c
··· 101 101 { 102 102 int tid; 103 103 struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl; 104 - struct host_cmd_ds_11n_delba *del_ba = 105 - (struct host_cmd_ds_11n_delba *) &resp->params.del_ba; 104 + struct host_cmd_ds_11n_delba *del_ba = &resp->params.del_ba; 106 105 uint16_t del_ba_param_set = le16_to_cpu(del_ba->del_ba_param_set); 107 106 108 107 tid = del_ba_param_set >> DELBA_TID_POS; ··· 146 147 struct host_cmd_ds_command *resp) 147 148 { 148 149 int tid; 149 - struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = 150 - (struct host_cmd_ds_11n_addba_rsp *) &resp->params.add_ba_rsp; 150 + struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = &resp->params.add_ba_rsp; 151 151 struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl; 152 152 153 153 add_ba_rsp->ssn = cpu_to_le16((le16_to_cpu(add_ba_rsp->ssn)) ··· 410 412 411 413 memcpy((u8 *) bss_co_2040 + 412 414 sizeof(struct mwifiex_ie_types_header), 413 - (u8 *) bss_desc->bcn_bss_co_2040 + 415 + bss_desc->bcn_bss_co_2040 + 414 416 sizeof(struct ieee_types_header), 415 417 le16_to_cpu(bss_co_2040->header.len)); 416 418 ··· 424 426 ext_cap->header.type = cpu_to_le16(WLAN_EID_EXT_CAPABILITY); 425 427 ext_cap->header.len = cpu_to_le16(sizeof(ext_cap->ext_cap)); 426 428 427 - memcpy((u8 *) ext_cap + 428 - sizeof(struct mwifiex_ie_types_header), 429 - (u8 *) bss_desc->bcn_ext_cap + 430 - sizeof(struct ieee_types_header), 429 + memcpy((u8 *)ext_cap + sizeof(struct mwifiex_ie_types_header), 430 + bss_desc->bcn_ext_cap + sizeof(struct ieee_types_header), 431 431 le16_to_cpu(ext_cap->header.len)); 432 432 433 433 *buffer += sizeof(struct mwifiex_ie_types_extcap);
+1 -2
drivers/net/wireless/mwifiex/11n.h
··· 105 105 priv = adapter->priv[i]; 106 106 if (priv) 107 107 ba_stream_num += mwifiex_wmm_list_len( 108 - (struct list_head *) 109 - &priv->tx_ba_stream_tbl_ptr); 108 + &priv->tx_ba_stream_tbl_ptr); 110 109 } 111 110 112 111 return ((ba_stream_num <
+5 -13
drivers/net/wireless/mwifiex/11n_rxreorder.c
··· 296 296 */ 297 297 int 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 = 300 - (struct host_cmd_ds_11n_addba_req *) 301 - &cmd->params.add_ba_req; 299 + struct host_cmd_ds_11n_addba_req *add_ba_req = &cmd->params.add_ba_req; 302 300 303 301 cmd->command = cpu_to_le16(HostCmd_CMD_11N_ADDBA_REQ); 304 302 cmd->size = cpu_to_le16(sizeof(*add_ba_req) + S_DS_GEN); ··· 318 320 struct host_cmd_ds_11n_addba_req 319 321 *cmd_addba_req) 320 322 { 321 - struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = 322 - (struct host_cmd_ds_11n_addba_rsp *) 323 - &cmd->params.add_ba_rsp; 323 + struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = &cmd->params.add_ba_rsp; 324 324 u8 tid; 325 325 int win_size; 326 326 uint16_t block_ack_param_set; ··· 363 367 */ 364 368 int mwifiex_cmd_11n_delba(struct host_cmd_ds_command *cmd, void *data_buf) 365 369 { 366 - struct host_cmd_ds_11n_delba *del_ba = (struct host_cmd_ds_11n_delba *) 367 - &cmd->params.del_ba; 370 + struct host_cmd_ds_11n_delba *del_ba = &cmd->params.del_ba; 368 371 369 372 cmd->command = cpu_to_le16(HostCmd_CMD_11N_DELBA); 370 373 cmd->size = cpu_to_le16(sizeof(*del_ba) + S_DS_GEN); ··· 393 398 int start_win, end_win, win_size; 394 399 u16 pkt_index; 395 400 396 - tbl = mwifiex_11n_get_rx_reorder_tbl((struct mwifiex_private *) priv, 397 - tid, ta); 401 + tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid, ta); 398 402 if (!tbl) { 399 403 if (pkt_type != PKT_TYPE_BAR) 400 404 mwifiex_process_rx_packet(priv->adapter, payload); ··· 514 520 int mwifiex_ret_11n_addba_resp(struct mwifiex_private *priv, 515 521 struct host_cmd_ds_command *resp) 516 522 { 517 - struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = 518 - (struct host_cmd_ds_11n_addba_rsp *) 519 - &resp->params.add_ba_rsp; 523 + struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = &resp->params.add_ba_rsp; 520 524 int tid, win_size; 521 525 struct mwifiex_rx_reorder_tbl *tbl; 522 526 uint16_t block_ack_param_set;
+1 -1
drivers/net/wireless/mwifiex/cfg80211.c
··· 1703 1703 wdev_priv = wiphy_priv(wiphy); 1704 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 1708 ret = wiphy_register(wiphy); 1709 1709 if (ret < 0) {
+7 -13
drivers/net/wireless/mwifiex/join.c
··· 1349 1349 { 1350 1350 u8 mac_address[ETH_ALEN]; 1351 1351 int ret; 1352 - u8 zero_mac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 }; 1353 1352 1354 - if (mac) { 1355 - if (!memcmp(mac, zero_mac, sizeof(zero_mac))) 1356 - memcpy((u8 *) &mac_address, 1357 - (u8 *) &priv->curr_bss_params.bss_descriptor. 1358 - mac_address, ETH_ALEN); 1359 - else 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 - } 1353 + if (!mac || is_zero_ether_addr(mac)) 1354 + memcpy(mac_address, 1355 + priv->curr_bss_params.bss_descriptor.mac_address, 1356 + ETH_ALEN); 1357 + else 1358 + memcpy(mac_address, mac, ETH_ALEN); 1365 1359 1366 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 1363 return ret; 1370 1364 }
+10 -14
drivers/net/wireless/mwifiex/scan.c
··· 1014 1014 case TLV_TYPE_TSFTIMESTAMP: 1015 1015 dev_dbg(adapter->dev, "info: SCAN_RESP: TSF " 1016 1016 "timestamp TLV, len = %d\n", tlv_len); 1017 - *tlv_data = (struct mwifiex_ie_types_data *) 1018 - current_tlv; 1017 + *tlv_data = current_tlv; 1019 1018 break; 1020 1019 case TLV_TYPE_CHANNELBANDLIST: 1021 1020 dev_dbg(adapter->dev, "info: SCAN_RESP: channel" 1022 1021 " band list TLV, len = %d\n", tlv_len); 1023 - *tlv_data = (struct mwifiex_ie_types_data *) 1024 - current_tlv; 1022 + *tlv_data = current_tlv; 1025 1023 break; 1026 1024 default: 1027 1025 dev_err(adapter->dev, ··· 1224 1226 bss_entry->beacon_buf); 1225 1227 break; 1226 1228 case WLAN_EID_BSS_COEX_2040: 1227 - bss_entry->bcn_bss_co_2040 = (u8 *) (current_ptr + 1228 - sizeof(struct ieee_types_header)); 1229 + bss_entry->bcn_bss_co_2040 = current_ptr + 1230 + sizeof(struct ieee_types_header); 1229 1231 bss_entry->bss_co_2040_offset = (u16) (current_ptr + 1230 1232 sizeof(struct ieee_types_header) - 1231 1233 bss_entry->beacon_buf); 1232 1234 break; 1233 1235 case WLAN_EID_EXT_CAPABILITY: 1234 - bss_entry->bcn_ext_cap = (u8 *) (current_ptr + 1235 - sizeof(struct ieee_types_header)); 1236 + bss_entry->bcn_ext_cap = current_ptr + 1237 + sizeof(struct ieee_types_header); 1236 1238 bss_entry->ext_cap_offset = (u16) (current_ptr + 1237 1239 sizeof(struct ieee_types_header) - 1238 1240 bss_entry->beacon_buf); ··· 1681 1683 goto done; 1682 1684 } 1683 1685 if (element_id == WLAN_EID_DS_PARAMS) { 1684 - channel = *(u8 *) (current_ptr + 1685 - sizeof(struct ieee_types_header)); 1686 + channel = *(current_ptr + sizeof(struct ieee_types_header)); 1686 1687 break; 1687 1688 } 1688 1689 ··· 2007 2010 2008 2011 if (curr_bss->bcn_bss_co_2040) 2009 2012 curr_bss->bcn_bss_co_2040 = 2010 - (u8 *) (curr_bss->beacon_buf + 2011 - curr_bss->bss_co_2040_offset); 2013 + (curr_bss->beacon_buf + curr_bss->bss_co_2040_offset); 2012 2014 2013 2015 if (curr_bss->bcn_ext_cap) 2014 - curr_bss->bcn_ext_cap = (u8 *) (curr_bss->beacon_buf + 2015 - curr_bss->ext_cap_offset); 2016 + curr_bss->bcn_ext_cap = curr_bss->beacon_buf + 2017 + curr_bss->ext_cap_offset; 2016 2018 } 2017 2019 2018 2020 /*
+5 -11
drivers/net/wireless/mwifiex/sta_cmd.c
··· 793 793 struct host_cmd_ds_mac_reg_access *mac_reg; 794 794 795 795 cmd->size = cpu_to_le16(sizeof(*mac_reg) + S_DS_GEN); 796 - mac_reg = (struct host_cmd_ds_mac_reg_access *) &cmd-> 797 - params.mac_reg; 796 + mac_reg = &cmd->params.mac_reg; 798 797 mac_reg->action = cpu_to_le16(cmd_action); 799 798 mac_reg->offset = 800 799 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); ··· 805 806 struct host_cmd_ds_bbp_reg_access *bbp_reg; 806 807 807 808 cmd->size = cpu_to_le16(sizeof(*bbp_reg) + S_DS_GEN); 808 - bbp_reg = (struct host_cmd_ds_bbp_reg_access *) 809 - &cmd->params.bbp_reg; 809 + bbp_reg = &cmd->params.bbp_reg; 810 810 bbp_reg->action = cpu_to_le16(cmd_action); 811 811 bbp_reg->offset = 812 812 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); ··· 817 819 struct host_cmd_ds_rf_reg_access *rf_reg; 818 820 819 821 cmd->size = cpu_to_le16(sizeof(*rf_reg) + S_DS_GEN); 820 - rf_reg = (struct host_cmd_ds_rf_reg_access *) 821 - &cmd->params.rf_reg; 822 + rf_reg = &cmd->params.rf_reg; 822 823 rf_reg->action = cpu_to_le16(cmd_action); 823 824 rf_reg->offset = cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 824 825 rf_reg->value = (u8) le32_to_cpu(reg_rw->value); ··· 828 831 struct host_cmd_ds_pmic_reg_access *pmic_reg; 829 832 830 833 cmd->size = cpu_to_le16(sizeof(*pmic_reg) + S_DS_GEN); 831 - pmic_reg = (struct host_cmd_ds_pmic_reg_access *) &cmd-> 832 - params.pmic_reg; 834 + pmic_reg = &cmd->params.pmic_reg; 833 835 pmic_reg->action = cpu_to_le16(cmd_action); 834 836 pmic_reg->offset = 835 837 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); ··· 840 844 struct host_cmd_ds_rf_reg_access *cau_reg; 841 845 842 846 cmd->size = cpu_to_le16(sizeof(*cau_reg) + S_DS_GEN); 843 - cau_reg = (struct host_cmd_ds_rf_reg_access *) 844 - &cmd->params.rf_reg; 847 + cau_reg = &cmd->params.rf_reg; 845 848 cau_reg->action = cpu_to_le16(cmd_action); 846 849 cau_reg->offset = 847 850 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); ··· 851 856 { 852 857 struct mwifiex_ds_read_eeprom *rd_eeprom = data_buf; 853 858 struct host_cmd_ds_802_11_eeprom_access *cmd_eeprom = 854 - (struct host_cmd_ds_802_11_eeprom_access *) 855 859 &cmd->params.eeprom; 856 860 857 861 cmd->size = cpu_to_le16(sizeof(*cmd_eeprom) + S_DS_GEN);
+9 -15
drivers/net/wireless/mwifiex/sta_cmdresp.c
··· 227 227 struct mwifiex_ds_get_stats *stats) 228 228 { 229 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 232 if (stats) { 233 233 stats->mcast_tx_frame = le32_to_cpu(get_log->mcast_tx_frame); ··· 282 282 u32 i; 283 283 int ret = 0; 284 284 285 - tlv_buf = (u8 *) ((u8 *) rate_cfg) + 285 + tlv_buf = ((u8 *)rate_cfg) + 286 286 sizeof(struct host_cmd_ds_tx_rate_cfg); 287 287 tlv_buf_len = *(u16 *) (tlv_buf + sizeof(u16)); 288 288 ··· 679 679 eeprom = data_buf; 680 680 switch (type) { 681 681 case HostCmd_CMD_MAC_REG_ACCESS: 682 - r.mac = (struct host_cmd_ds_mac_reg_access *) 683 - &resp->params.mac_reg; 682 + r.mac = &resp->params.mac_reg; 684 683 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.mac->offset)); 685 684 reg_rw->value = r.mac->value; 686 685 break; 687 686 case HostCmd_CMD_BBP_REG_ACCESS: 688 - r.bbp = (struct host_cmd_ds_bbp_reg_access *) 689 - &resp->params.bbp_reg; 687 + r.bbp = &resp->params.bbp_reg; 690 688 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.bbp->offset)); 691 689 reg_rw->value = cpu_to_le32((u32) r.bbp->value); 692 690 break; 693 691 694 692 case HostCmd_CMD_RF_REG_ACCESS: 695 - r.rf = (struct host_cmd_ds_rf_reg_access *) 696 - &resp->params.rf_reg; 693 + r.rf = &resp->params.rf_reg; 697 694 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset)); 698 695 reg_rw->value = cpu_to_le32((u32) r.bbp->value); 699 696 break; 700 697 case HostCmd_CMD_PMIC_REG_ACCESS: 701 - r.pmic = (struct host_cmd_ds_pmic_reg_access *) 702 - &resp->params.pmic_reg; 698 + r.pmic = &resp->params.pmic_reg; 703 699 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.pmic->offset)); 704 700 reg_rw->value = cpu_to_le32((u32) r.pmic->value); 705 701 break; 706 702 case HostCmd_CMD_CAU_REG_ACCESS: 707 - r.rf = (struct host_cmd_ds_rf_reg_access *) 708 - &resp->params.rf_reg; 703 + r.rf = &resp->params.rf_reg; 709 704 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset)); 710 705 reg_rw->value = cpu_to_le32((u32) r.rf->value); 711 706 break; 712 707 case HostCmd_CMD_802_11_EEPROM_ACCESS: 713 - r.eeprom = (struct host_cmd_ds_802_11_eeprom_access *) 714 - &resp->params.eeprom; 708 + r.eeprom = &resp->params.eeprom; 715 709 pr_debug("info: EEPROM read len=%x\n", r.eeprom->byte_count); 716 710 if (le16_to_cpu(eeprom->byte_count) < 717 711 le16_to_cpu(r.eeprom->byte_count)) { ··· 781 787 struct mwifiex_ds_misc_subsc_evt *sub_event) 782 788 { 783 789 struct host_cmd_ds_802_11_subsc_evt *cmd_sub_event = 784 - (struct host_cmd_ds_802_11_subsc_evt *)&resp->params.subsc_evt; 790 + &resp->params.subsc_evt; 785 791 786 792 /* For every subscribe event command (Get/Set/Clear), FW reports the 787 793 * current set of subscribed events*/
+1 -1
drivers/net/wireless/mwifiex/sta_event.c
··· 422 422 423 423 if (len != -1) { 424 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 426 len = (u8 *)sinfo.assoc_req_ies - 427 427 (u8 *)&event->frame_control; 428 428 sinfo.assoc_req_ies_len =
+1 -1
drivers/net/wireless/p54/eeprom.c
··· 905 905 906 906 while (eeprom_size) { 907 907 blocksize = min(eeprom_size, maxblocksize); 908 - ret = p54_download_eeprom(priv, (void *) (eeprom + offset), 908 + ret = p54_download_eeprom(priv, eeprom + offset, 909 909 offset, blocksize); 910 910 if (unlikely(ret)) 911 911 goto free;
+1 -1
drivers/net/wireless/p54/fwio.c
··· 478 478 479 479 if (priv->rxhw == PDR_SYNTH_FRONTEND_LONGBOW) { 480 480 memcpy(&body->longbow.curve_data, 481 - (void *) entry + sizeof(__le16), 481 + entry + sizeof(__le16), 482 482 priv->curve_data->entry_size); 483 483 } else { 484 484 struct p54_scan_body *chan = &body->normal;
+1 -1
drivers/net/wireless/prism54/islpci_eth.c
··· 455 455 "Error mapping DMA address\n"); 456 456 457 457 /* free the skbuf structure before aborting */ 458 - dev_kfree_skb_irq((struct sk_buff *) skb); 458 + dev_kfree_skb_irq(skb); 459 459 skb = NULL; 460 460 break; 461 461 }
+1 -1
drivers/net/wireless/ray_cs.c
··· 1849 1849 pr_debug("ray_cs: interrupt for *dev=%p\n", dev); 1850 1850 1851 1851 local = netdev_priv(dev); 1852 - link = (struct pcmcia_device *)local->finder; 1852 + link = local->finder; 1853 1853 if (!pcmcia_dev_present(link)) { 1854 1854 pr_debug( 1855 1855 "ray_cs interrupt from device not present or suspended.\n");
+1 -1
drivers/net/wireless/rtlwifi/base.c
··· 907 907 struct ieee80211_hdr *hdr = rtl_get_hdr(skb); 908 908 struct rtl_priv *rtlpriv = rtl_priv(hw); 909 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 911 u8 category; 912 912 913 913 if (!ieee80211_is_action(fc))
+1 -1
drivers/net/wireless/rtlwifi/cam.c
··· 146 146 } 147 147 148 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 151 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "<===\n"); 152 152
+7 -7
drivers/net/wireless/rtlwifi/core.c
··· 680 680 681 681 mac->short_preamble = bss_conf->use_short_preamble; 682 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 686 if (changed & BSS_CHANGED_ERP_SLOT) { ··· 693 693 mac->slot_time = RTL_SLOT_TIME_20; 694 694 695 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 699 if (changed & BSS_CHANGED_HT) { ··· 713 713 rcu_read_unlock(); 714 714 715 715 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SHORTGI_DENSITY, 716 - (u8 *) (&mac->max_mss_density)); 716 + &mac->max_mss_density); 717 717 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AMPDU_FACTOR, 718 718 &mac->current_ampdu_factor); 719 719 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AMPDU_MIN_SPACE, ··· 801 801 u8 mstatus = RT_MEDIA_CONNECT; 802 802 rtlpriv->cfg->ops->set_hw_reg(hw, 803 803 HW_VAR_H2C_FW_JOINBSSRPT, 804 - (u8 *) (&mstatus)); 804 + &mstatus); 805 805 ppsc->report_linked = true; 806 806 } 807 807 } else { ··· 809 809 u8 mstatus = RT_MEDIA_DISCONNECT; 810 810 rtlpriv->cfg->ops->set_hw_reg(hw, 811 811 HW_VAR_H2C_FW_JOINBSSRPT, 812 - (u8 *)(&mstatus)); 812 + &mstatus); 813 813 ppsc->report_linked = false; 814 814 } 815 815 } ··· 836 836 u8 bibss = (mac->opmode == NL80211_IFTYPE_ADHOC) ? 1 : 0; 837 837 838 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 842 842 static void rtl_op_reset_tsf(struct ieee80211_hw *hw, ··· 845 845 struct rtl_priv *rtlpriv = rtl_priv(hw); 846 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 851 851 static void rtl_op_sta_notify(struct ieee80211_hw *hw,
+2 -2
drivers/net/wireless/rtlwifi/efuse.c
··· 352 352 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_EFUSE_BYTES, 353 353 (u8 *)&efuse_utilized); 354 354 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_EFUSE_USAGE, 355 - (u8 *)&efuse_usage); 355 + &efuse_usage); 356 356 done: 357 357 for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) 358 358 kfree(efuse_word[i]); ··· 409 409 else if (type == 2) 410 410 efuse_shadow_read_2byte(hw, offset, (u16 *) value); 411 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
+7 -7
drivers/net/wireless/rtlwifi/pci.c
··· 756 756 if (index == rtlpci->rxringcount - 1) 757 757 rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false, 758 758 HW_DESC_RXERO, 759 - (u8 *)&tmp_one); 759 + &tmp_one); 760 760 761 761 rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false, HW_DESC_RXOWN, 762 - (u8 *)&tmp_one); 762 + &tmp_one); 763 763 764 764 index = (index + 1) % rtlpci->rxringcount; 765 765 } ··· 934 934 __skb_queue_tail(&ring->queue, pskb); 935 935 936 936 rtlpriv->cfg->ops->set_desc((u8 *) pdesc, true, HW_DESC_OWN, 937 - (u8 *)&temp_one); 937 + &temp_one); 938 938 939 939 return; 940 940 } ··· 1126 1126 rxbuffersize); 1127 1127 rtlpriv->cfg->ops->set_desc((u8 *) entry, false, 1128 1128 HW_DESC_RXOWN, 1129 - (u8 *)&tmp_one); 1129 + &tmp_one); 1130 1130 } 1131 1131 1132 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 1135 return 0; 1136 1136 } ··· 1263 1263 rtlpriv->cfg->ops->set_desc((u8 *) entry, 1264 1264 false, 1265 1265 HW_DESC_RXOWN, 1266 - (u8 *)&tmp_one); 1266 + &tmp_one); 1267 1267 } 1268 1268 rtlpci->rx_ring[rx_queue_idx].idx = 0; 1269 1269 } ··· 1422 1422 __skb_queue_tail(&ring->queue, skb); 1423 1423 1424 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 1428 if ((ring->entries - skb_queue_len(&ring->queue)) < 2 &&
+5 -5
drivers/net/wireless/rtlwifi/ps.c
··· 333 333 rpwm_val = 0x0C; /* RF on */ 334 334 fw_pwrmode = FW_PS_ACTIVE_MODE; 335 335 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SET_RPWM, 336 - (u8 *) (&rpwm_val)); 336 + &rpwm_val); 337 337 rtlpriv->cfg->ops->set_hw_reg(hw, 338 338 HW_VAR_H2C_FW_PWRMODE, 339 - (u8 *) (&fw_pwrmode)); 339 + &fw_pwrmode); 340 340 fw_current_inps = false; 341 341 342 342 rtlpriv->cfg->ops->set_hw_reg(hw, ··· 356 356 (u8 *) (&fw_current_inps)); 357 357 rtlpriv->cfg->ops->set_hw_reg(hw, 358 358 HW_VAR_H2C_FW_PWRMODE, 359 - (u8 *) (&ppsc->fwctrl_psmode)); 359 + &ppsc->fwctrl_psmode); 360 360 361 361 rtlpriv->cfg->ops->set_hw_reg(hw, 362 362 HW_VAR_SET_RPWM, 363 - (u8 *) (&rpwm_val)); 363 + &rpwm_val); 364 364 } else { 365 365 /* Reset the power save related parameters. */ 366 366 ppsc->dot11_psmode = EACTIVE; ··· 446 446 { 447 447 struct rtl_priv *rtlpriv = rtl_priv(hw); 448 448 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 449 - struct ieee80211_hdr *hdr = (void *) data; 449 + struct ieee80211_hdr *hdr = data; 450 450 struct ieee80211_tim_ie *tim_ie; 451 451 u8 *tim; 452 452 u8 tim_len;
+2 -3
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
··· 656 656 } else { 657 657 if (rtlpriv->dm.current_turbo_edca) { 658 658 u8 tmp = AC0_BE; 659 - rtlpriv->cfg->ops->set_hw_reg(hw, 660 - HW_VAR_AC_PARAM, 661 - (u8 *) (&tmp)); 659 + rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AC_PARAM, 660 + &tmp); 662 661 rtlpriv->dm.current_turbo_edca = false; 663 662 } 664 663 }
+2 -2
drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
··· 168 168 { 169 169 struct rtl_priv *rtlpriv = rtl_priv(hw); 170 170 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 171 - u8 *bufferPtr = (u8 *) buffer; 171 + u8 *bufferPtr = buffer; 172 172 173 173 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, "FW size is %d bytes\n", size); 174 174 ··· 262 262 return 1; 263 263 264 264 pfwheader = (struct rtl92c_firmware_header *)rtlhal->pfirmware; 265 - pfwdata = (u8 *) rtlhal->pfirmware; 265 + pfwdata = rtlhal->pfirmware; 266 266 fwsize = rtlhal->fwsize; 267 267 268 268 if (IS_FW_HEADER_EXIST(pfwheader)) {
+21 -22
drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
··· 214 214 for (e_aci = 0; e_aci < AC_MAX; e_aci++) { 215 215 rtlpriv->cfg->ops->set_hw_reg(hw, 216 216 HW_VAR_AC_PARAM, 217 - (u8 *) (&e_aci)); 217 + &e_aci); 218 218 } 219 219 break; 220 220 } 221 221 case HW_VAR_ACK_PREAMBLE:{ 222 222 u8 reg_tmp; 223 - u8 short_preamble = (bool) (*(u8 *) val); 223 + u8 short_preamble = (bool)*val; 224 224 reg_tmp = (mac->cur_40_prime_sc) << 5; 225 225 if (short_preamble) 226 226 reg_tmp |= 0x80; ··· 232 232 u8 min_spacing_to_set; 233 233 u8 sec_min_space; 234 234 235 - min_spacing_to_set = *((u8 *) val); 235 + min_spacing_to_set = *val; 236 236 if (min_spacing_to_set <= 7) { 237 237 sec_min_space = 0; 238 238 ··· 257 257 case HW_VAR_SHORTGI_DENSITY:{ 258 258 u8 density_to_set; 259 259 260 - density_to_set = *((u8 *) val); 260 + density_to_set = *val; 261 261 mac->min_space_cfg |= (density_to_set << 3); 262 262 263 263 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, ··· 284 284 else 285 285 p_regtoset = regtoset_normal; 286 286 287 - factor_toset = *((u8 *) val); 287 + factor_toset = *(val); 288 288 if (factor_toset <= 3) { 289 289 factor_toset = (1 << (factor_toset + 2)); 290 290 if (factor_toset > 0xf) ··· 316 316 break; 317 317 } 318 318 case HW_VAR_AC_PARAM:{ 319 - u8 e_aci = *((u8 *) val); 319 + u8 e_aci = *(val); 320 320 rtl92c_dm_init_edca_turbo(hw); 321 321 322 322 if (rtlpci->acm_method != eAcmWay2_SW) 323 323 rtlpriv->cfg->ops->set_hw_reg(hw, 324 324 HW_VAR_ACM_CTRL, 325 - (u8 *) (&e_aci)); 325 + (&e_aci)); 326 326 break; 327 327 } 328 328 case HW_VAR_ACM_CTRL:{ 329 - u8 e_aci = *((u8 *) val); 329 + u8 e_aci = *(val); 330 330 union aci_aifsn *p_aci_aifsn = 331 331 (union aci_aifsn *)(&(mac->ac[0].aifs)); 332 332 u8 acm = p_aci_aifsn->f.acm; ··· 382 382 break; 383 383 } 384 384 case HW_VAR_RETRY_LIMIT:{ 385 - u8 retry_limit = ((u8 *) (val))[0]; 385 + u8 retry_limit = val[0]; 386 386 387 387 rtl_write_word(rtlpriv, REG_RL, 388 388 retry_limit << RETRY_LIMIT_SHORT_SHIFT | ··· 396 396 rtlefuse->efuse_usedbytes = *((u16 *) val); 397 397 break; 398 398 case HW_VAR_EFUSE_USAGE: 399 - rtlefuse->efuse_usedpercentage = *((u8 *) val); 399 + rtlefuse->efuse_usedpercentage = *val; 400 400 break; 401 401 case HW_VAR_IO_CMD: 402 402 rtl92c_phy_set_io_cmd(hw, (*(enum io_type *)val)); 403 403 break; 404 404 case HW_VAR_WPA_CONFIG: 405 - rtl_write_byte(rtlpriv, REG_SECCFG, *((u8 *) val)); 405 + rtl_write_byte(rtlpriv, REG_SECCFG, *val); 406 406 break; 407 407 case HW_VAR_SET_RPWM:{ 408 408 u8 rpwm_val; ··· 411 411 udelay(1); 412 412 413 413 if (rpwm_val & BIT(7)) { 414 - rtl_write_byte(rtlpriv, REG_PCIE_HRPWM, 415 - (*(u8 *) val)); 414 + rtl_write_byte(rtlpriv, REG_PCIE_HRPWM, *val); 416 415 } else { 417 416 rtl_write_byte(rtlpriv, REG_PCIE_HRPWM, 418 - ((*(u8 *) val) | BIT(7))); 417 + *val | BIT(7)); 419 418 } 420 419 421 420 break; 422 421 } 423 422 case HW_VAR_H2C_FW_PWRMODE:{ 424 - u8 psmode = (*(u8 *) val); 423 + u8 psmode = *val; 425 424 426 425 if ((psmode != FW_PS_ACTIVE_MODE) && 427 426 (!IS_92C_SERIAL(rtlhal->version))) { 428 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 431 break; 433 432 } 434 433 case HW_VAR_FW_PSMODE_STATUS: 435 434 ppsc->fw_current_inpsmode = *((bool *) val); 436 435 break; 437 436 case HW_VAR_H2C_FW_JOINBSSRPT:{ 438 - u8 mstatus = (*(u8 *) val); 437 + u8 mstatus = *val; 439 438 u8 tmp_regcr, tmp_reg422; 440 439 bool recover = false; 441 440 ··· 471 472 rtl_write_byte(rtlpriv, REG_CR + 1, 472 473 (tmp_regcr & ~(BIT(0)))); 473 474 } 474 - rtl92c_set_fw_joinbss_report_cmd(hw, (*(u8 *) val)); 475 + rtl92c_set_fw_joinbss_report_cmd(hw, *val); 475 476 476 477 break; 477 478 } ··· 485 486 break; 486 487 } 487 488 case HW_VAR_CORRECT_TSF:{ 488 - u8 btype_ibss = ((u8 *) (val))[0]; 489 + u8 btype_ibss = val[0]; 489 490 490 491 if (btype_ibss) 491 492 _rtl92ce_stop_tx_beacon(hw); ··· 1588 1589 rtlefuse->autoload_failflag, 1589 1590 hwinfo); 1590 1591 1591 - rtlefuse->eeprom_channelplan = *(u8 *)&hwinfo[EEPROM_CHANNELPLAN]; 1592 + rtlefuse->eeprom_channelplan = *&hwinfo[EEPROM_CHANNELPLAN]; 1592 1593 rtlefuse->eeprom_version = *(u16 *)&hwinfo[EEPROM_VERSION]; 1593 1594 rtlefuse->txpwr_fromeprom = true; 1594 - rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMER_ID]; 1595 + rtlefuse->eeprom_oemid = *&hwinfo[EEPROM_CUSTOMER_ID]; 1595 1596 1596 1597 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1597 1598 "EEPROM Customer ID: 0x%2x\n", rtlefuse->eeprom_oemid); ··· 1938 1939 u16 sifs_timer; 1939 1940 1940 1941 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME, 1941 - (u8 *)&mac->slot_time); 1942 + &mac->slot_time); 1942 1943 if (!mac->ht_enable) 1943 1944 sifs_timer = 0x0a0a; 1944 1945 else
+2 -2
drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
··· 605 605 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); 606 606 bool defaultadapter = true; 607 607 struct ieee80211_sta *sta; 608 - u8 *pdesc = (u8 *) pdesc_tx; 608 + u8 *pdesc = pdesc_tx; 609 609 u16 seq_number; 610 610 __le16 fc = hdr->frame_control; 611 611 u8 fw_qsel = _rtl92ce_map_hwqueue_to_fwqueue(skb, hw_queue); ··· 806 806 807 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 811 SET_TX_DESC_FIRST_SEG(pdesc, 1); 812 812 SET_TX_DESC_LAST_SEG(pdesc, 1);
+21 -22
drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
··· 381 381 rtlefuse->eeprom_did = le16_to_cpu(*(__le16 *)&hwinfo[EEPROM_DID]); 382 382 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, " VID = 0x%02x PID = 0x%02x\n", 383 383 rtlefuse->eeprom_vid, rtlefuse->eeprom_did); 384 - rtlefuse->eeprom_channelplan = *(u8 *)&hwinfo[EEPROM_CHANNELPLAN]; 384 + rtlefuse->eeprom_channelplan = hwinfo[EEPROM_CHANNELPLAN]; 385 385 rtlefuse->eeprom_version = 386 386 le16_to_cpu(*(__le16 *)&hwinfo[EEPROM_VERSION]); 387 387 rtlefuse->txpwr_fromeprom = true; 388 - rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMER_ID]; 388 + rtlefuse->eeprom_oemid = hwinfo[EEPROM_CUSTOMER_ID]; 389 389 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "EEPROM Customer ID: 0x%2x\n", 390 390 rtlefuse->eeprom_oemid); 391 391 if (rtlhal->oem_id == RT_CID_DEFAULT) { ··· 1660 1660 for (e_aci = 0; e_aci < AC_MAX; e_aci++) 1661 1661 rtlpriv->cfg->ops->set_hw_reg(hw, 1662 1662 HW_VAR_AC_PARAM, 1663 - (u8 *)(&e_aci)); 1663 + &e_aci); 1664 1664 } else { 1665 1665 u8 sifstime = 0; 1666 1666 u8 u1bAIFS; ··· 1685 1685 } 1686 1686 case HW_VAR_ACK_PREAMBLE:{ 1687 1687 u8 reg_tmp; 1688 - u8 short_preamble = (bool) (*(u8 *) val); 1688 + u8 short_preamble = (bool)*val; 1689 1689 reg_tmp = 0; 1690 1690 if (short_preamble) 1691 1691 reg_tmp |= 0x80; ··· 1696 1696 u8 min_spacing_to_set; 1697 1697 u8 sec_min_space; 1698 1698 1699 - min_spacing_to_set = *((u8 *) val); 1699 + min_spacing_to_set = *val; 1700 1700 if (min_spacing_to_set <= 7) { 1701 1701 switch (rtlpriv->sec.pairwise_enc_algorithm) { 1702 1702 case NO_ENCRYPTION: ··· 1729 1729 case HW_VAR_SHORTGI_DENSITY:{ 1730 1730 u8 density_to_set; 1731 1731 1732 - density_to_set = *((u8 *) val); 1732 + density_to_set = *val; 1733 1733 density_to_set &= 0x1f; 1734 1734 mac->min_space_cfg &= 0x07; 1735 1735 mac->min_space_cfg |= (density_to_set << 3); ··· 1747 1747 u8 index = 0; 1748 1748 1749 1749 p_regtoset = regtoset_normal; 1750 - factor_toset = *((u8 *) val); 1750 + factor_toset = *val; 1751 1751 if (factor_toset <= 3) { 1752 1752 factor_toset = (1 << (factor_toset + 2)); 1753 1753 if (factor_toset > 0xf) ··· 1774 1774 break; 1775 1775 } 1776 1776 case HW_VAR_AC_PARAM:{ 1777 - u8 e_aci = *((u8 *) val); 1777 + u8 e_aci = *val; 1778 1778 u32 u4b_ac_param; 1779 1779 u16 cw_min = le16_to_cpu(mac->ac[e_aci].cw_min); 1780 1780 u16 cw_max = le16_to_cpu(mac->ac[e_aci].cw_max); ··· 1814 1814 } 1815 1815 if (rtlusb->acm_method != eAcmWay2_SW) 1816 1816 rtlpriv->cfg->ops->set_hw_reg(hw, 1817 - HW_VAR_ACM_CTRL, (u8 *)(&e_aci)); 1817 + HW_VAR_ACM_CTRL, &e_aci); 1818 1818 break; 1819 1819 } 1820 1820 case HW_VAR_ACM_CTRL:{ 1821 - u8 e_aci = *((u8 *) val); 1821 + u8 e_aci = *val; 1822 1822 union aci_aifsn *p_aci_aifsn = (union aci_aifsn *) 1823 1823 (&(mac->ac[0].aifs)); 1824 1824 u8 acm = p_aci_aifsn->f.acm; ··· 1874 1874 break; 1875 1875 } 1876 1876 case HW_VAR_RETRY_LIMIT:{ 1877 - u8 retry_limit = ((u8 *) (val))[0]; 1877 + u8 retry_limit = val[0]; 1878 1878 1879 1879 rtl_write_word(rtlpriv, REG_RL, 1880 1880 retry_limit << RETRY_LIMIT_SHORT_SHIFT | ··· 1891 1891 rtlefuse->efuse_usedbytes = *((u16 *) val); 1892 1892 break; 1893 1893 case HW_VAR_EFUSE_USAGE: 1894 - rtlefuse->efuse_usedpercentage = *((u8 *) val); 1894 + rtlefuse->efuse_usedpercentage = *val; 1895 1895 break; 1896 1896 case HW_VAR_IO_CMD: 1897 1897 rtl92c_phy_set_io_cmd(hw, (*(enum io_type *)val)); 1898 1898 break; 1899 1899 case HW_VAR_WPA_CONFIG: 1900 - rtl_write_byte(rtlpriv, REG_SECCFG, *((u8 *) val)); 1900 + rtl_write_byte(rtlpriv, REG_SECCFG, *val); 1901 1901 break; 1902 1902 case HW_VAR_SET_RPWM:{ 1903 1903 u8 rpwm_val = rtl_read_byte(rtlpriv, REG_USB_HRPWM); 1904 1904 1905 1905 if (rpwm_val & BIT(7)) 1906 - rtl_write_byte(rtlpriv, REG_USB_HRPWM, 1907 - (*(u8 *)val)); 1906 + rtl_write_byte(rtlpriv, REG_USB_HRPWM, *val); 1908 1907 else 1909 1908 rtl_write_byte(rtlpriv, REG_USB_HRPWM, 1910 - ((*(u8 *)val) | BIT(7))); 1909 + *val | BIT(7)); 1911 1910 break; 1912 1911 } 1913 1912 case HW_VAR_H2C_FW_PWRMODE:{ 1914 - u8 psmode = (*(u8 *) val); 1913 + u8 psmode = *val; 1915 1914 1916 1915 if ((psmode != FW_PS_ACTIVE_MODE) && 1917 1916 (!IS_92C_SERIAL(rtlhal->version))) 1918 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 1919 break; 1921 1920 } 1922 1921 case HW_VAR_FW_PSMODE_STATUS: 1923 1922 ppsc->fw_current_inpsmode = *((bool *) val); 1924 1923 break; 1925 1924 case HW_VAR_H2C_FW_JOINBSSRPT:{ 1926 - u8 mstatus = (*(u8 *) val); 1925 + u8 mstatus = *val; 1927 1926 u8 tmp_reg422; 1928 1927 bool recover = false; 1929 1928 ··· 1947 1948 tmp_reg422 | BIT(6)); 1948 1949 rtl_write_byte(rtlpriv, REG_CR + 1, 0x02); 1949 1950 } 1950 - rtl92c_set_fw_joinbss_report_cmd(hw, (*(u8 *) val)); 1951 + rtl92c_set_fw_joinbss_report_cmd(hw, (*val)); 1951 1952 break; 1952 1953 } 1953 1954 case HW_VAR_AID:{ ··· 1960 1961 break; 1961 1962 } 1962 1963 case HW_VAR_CORRECT_TSF:{ 1963 - u8 btype_ibss = ((u8 *) (val))[0]; 1964 + u8 btype_ibss = val[0]; 1964 1965 1965 1966 if (btype_ibss) 1966 1967 _rtl92cu_stop_tx_beacon(hw); ··· 2183 2184 u16 sifs_timer; 2184 2185 2185 2186 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME, 2186 - (u8 *)&mac->slot_time); 2187 + &mac->slot_time); 2187 2188 if (!mac->ht_enable) 2188 2189 sifs_timer = 0x0a0a; 2189 2190 else
+1 -1
drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
··· 668 668 SET_TX_DESC_RATE_ID(pdesc, 7); 669 669 SET_TX_DESC_MACID(pdesc, 0); 670 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 672 SET_TX_DESC_FIRST_SEG(pdesc, 1); 673 673 SET_TX_DESC_LAST_SEG(pdesc, 1); 674 674 SET_TX_DESC_OFFSET(pdesc, 0x20);
+1 -1
drivers/net/wireless/rtlwifi/rtl8192de/dm.c
··· 696 696 if (rtlpriv->dm.current_turbo_edca) { 697 697 u8 tmp = AC0_BE; 698 698 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AC_PARAM, 699 - (u8 *) (&tmp)); 699 + &tmp); 700 700 rtlpriv->dm.current_turbo_edca = false; 701 701 } 702 702 }
+3 -3
drivers/net/wireless/rtlwifi/rtl8192de/fw.c
··· 120 120 { 121 121 struct rtl_priv *rtlpriv = rtl_priv(hw); 122 122 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 123 - u8 *bufferPtr = (u8 *) buffer; 123 + u8 *bufferPtr = buffer; 124 124 u32 pagenums, remainSize; 125 125 u32 page, offset; 126 126 ··· 256 256 if (rtlpriv->max_fw_size == 0 || !rtlhal->pfirmware) 257 257 return 1; 258 258 fwsize = rtlhal->fwsize; 259 - pfwheader = (u8 *) rtlhal->pfirmware; 260 - pfwdata = (u8 *) rtlhal->pfirmware; 259 + pfwheader = rtlhal->pfirmware; 260 + pfwdata = rtlhal->pfirmware; 261 261 rtlhal->fw_version = (u16) GET_FIRMWARE_HDR_VERSION(pfwheader); 262 262 rtlhal->fw_subversion = (u16) GET_FIRMWARE_HDR_SUB_VER(pfwheader); 263 263 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
+17 -17
drivers/net/wireless/rtlwifi/rtl8192de/hw.c
··· 235 235 for (e_aci = 0; e_aci < AC_MAX; e_aci++) 236 236 rtlpriv->cfg->ops->set_hw_reg(hw, 237 237 HW_VAR_AC_PARAM, 238 - (u8 *) (&e_aci)); 238 + (&e_aci)); 239 239 break; 240 240 } 241 241 case HW_VAR_ACK_PREAMBLE: { 242 242 u8 reg_tmp; 243 - u8 short_preamble = (bool) (*(u8 *) val); 243 + u8 short_preamble = (bool) (*val); 244 244 245 245 reg_tmp = (mac->cur_40_prime_sc) << 5; 246 246 if (short_preamble) ··· 252 252 u8 min_spacing_to_set; 253 253 u8 sec_min_space; 254 254 255 - min_spacing_to_set = *((u8 *) val); 255 + min_spacing_to_set = *val; 256 256 if (min_spacing_to_set <= 7) { 257 257 sec_min_space = 0; 258 258 if (min_spacing_to_set < sec_min_space) ··· 271 271 case HW_VAR_SHORTGI_DENSITY: { 272 272 u8 density_to_set; 273 273 274 - density_to_set = *((u8 *) val); 274 + density_to_set = *val; 275 275 mac->min_space_cfg = rtlpriv->rtlhal.minspace_cfg; 276 276 mac->min_space_cfg |= (density_to_set << 3); 277 277 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, ··· 293 293 regtoSet = 0x66626641; 294 294 else 295 295 regtoSet = 0xb972a841; 296 - factor_toset = *((u8 *) val); 296 + factor_toset = *val; 297 297 if (factor_toset <= 3) { 298 298 factor_toset = (1 << (factor_toset + 2)); 299 299 if (factor_toset > 0xf) ··· 316 316 break; 317 317 } 318 318 case HW_VAR_AC_PARAM: { 319 - u8 e_aci = *((u8 *) val); 319 + u8 e_aci = *val; 320 320 rtl92d_dm_init_edca_turbo(hw); 321 321 if (rtlpci->acm_method != eAcmWay2_SW) 322 322 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ACM_CTRL, 323 - (u8 *) (&e_aci)); 323 + &e_aci); 324 324 break; 325 325 } 326 326 case HW_VAR_ACM_CTRL: { 327 - u8 e_aci = *((u8 *) val); 327 + u8 e_aci = *val; 328 328 union aci_aifsn *p_aci_aifsn = 329 329 (union aci_aifsn *)(&(mac->ac[0].aifs)); 330 330 u8 acm = p_aci_aifsn->f.acm; ··· 376 376 rtlpci->receive_config = ((u32 *) (val))[0]; 377 377 break; 378 378 case HW_VAR_RETRY_LIMIT: { 379 - u8 retry_limit = ((u8 *) (val))[0]; 379 + u8 retry_limit = val[0]; 380 380 381 381 rtl_write_word(rtlpriv, REG_RL, 382 382 retry_limit << RETRY_LIMIT_SHORT_SHIFT | ··· 390 390 rtlefuse->efuse_usedbytes = *((u16 *) val); 391 391 break; 392 392 case HW_VAR_EFUSE_USAGE: 393 - rtlefuse->efuse_usedpercentage = *((u8 *) val); 393 + rtlefuse->efuse_usedpercentage = *val; 394 394 break; 395 395 case HW_VAR_IO_CMD: 396 396 rtl92d_phy_set_io_cmd(hw, (*(enum io_type *)val)); 397 397 break; 398 398 case HW_VAR_WPA_CONFIG: 399 - rtl_write_byte(rtlpriv, REG_SECCFG, *((u8 *) val)); 399 + rtl_write_byte(rtlpriv, REG_SECCFG, *val); 400 400 break; 401 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 403 break; 404 404 case HW_VAR_H2C_FW_PWRMODE: 405 405 break; ··· 407 407 ppsc->fw_current_inpsmode = *((bool *) val); 408 408 break; 409 409 case HW_VAR_H2C_FW_JOINBSSRPT: { 410 - u8 mstatus = (*(u8 *) val); 410 + u8 mstatus = (*val); 411 411 u8 tmp_regcr, tmp_reg422; 412 412 bool recover = false; 413 413 ··· 435 435 rtl_write_byte(rtlpriv, REG_CR + 1, 436 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 439 break; 440 440 } 441 441 case HW_VAR_AID: { ··· 447 447 break; 448 448 } 449 449 case HW_VAR_CORRECT_TSF: { 450 - u8 btype_ibss = ((u8 *) (val))[0]; 450 + u8 btype_ibss = val[0]; 451 451 452 452 if (btype_ibss) 453 453 _rtl92de_stop_tx_beacon(hw); ··· 1794 1794 "RTL819X Not boot from eeprom, check it !!\n"); 1795 1795 return; 1796 1796 } 1797 - rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMER_ID]; 1797 + rtlefuse->eeprom_oemid = hwinfo[EEPROM_CUSTOMER_ID]; 1798 1798 _rtl92de_read_macphymode_and_bandtype(hw, hwinfo); 1799 1799 1800 1800 /* VID, DID SE 0xA-D */ ··· 2115 2115 u16 sifs_timer; 2116 2116 2117 2117 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME, 2118 - (u8 *)&mac->slot_time); 2118 + &mac->slot_time); 2119 2119 if (!mac->ht_enable) 2120 2120 sifs_timer = 0x0a0a; 2121 2121 else
+3 -3
drivers/net/wireless/rtlwifi/rtl8192de/trx.c
··· 560 560 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); 561 561 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); 562 562 struct ieee80211_sta *sta = info->control.sta; 563 - u8 *pdesc = (u8 *) pdesc_tx; 563 + u8 *pdesc = pdesc_tx; 564 564 u16 seq_number; 565 565 __le16 fc = hdr->frame_control; 566 566 unsigned int buf_len = 0; ··· 761 761 SET_TX_DESC_QUEUE_SEL(pdesc, fw_queue); 762 762 SET_TX_DESC_FIRST_SEG(pdesc, 1); 763 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 765 SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping); 766 766 SET_TX_DESC_RATE_ID(pdesc, 7); 767 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 769 SET_TX_DESC_FIRST_SEG(pdesc, 1); 770 770 SET_TX_DESC_LAST_SEG(pdesc, 1); 771 771 SET_TX_DESC_OFFSET(pdesc, 0x20);
+1 -1
drivers/net/wireless/rtlwifi/rtl8192se/dm.c
··· 146 146 if (rtlpriv->dm.current_turbo_edca) { 147 147 u8 tmp = AC0_BE; 148 148 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AC_PARAM, 149 - (u8 *)(&tmp)); 149 + &tmp); 150 150 rtlpriv->dm.current_turbo_edca = false; 151 151 } 152 152 }
+22 -24
drivers/net/wireless/rtlwifi/rtl8192se/hw.c
··· 145 145 for (e_aci = 0; e_aci < AC_MAX; e_aci++) { 146 146 rtlpriv->cfg->ops->set_hw_reg(hw, 147 147 HW_VAR_AC_PARAM, 148 - (u8 *)(&e_aci)); 148 + (&e_aci)); 149 149 } 150 150 break; 151 151 } 152 152 case HW_VAR_ACK_PREAMBLE:{ 153 153 u8 reg_tmp; 154 - u8 short_preamble = (bool) (*(u8 *) val); 154 + u8 short_preamble = (bool) (*val); 155 155 reg_tmp = (mac->cur_40_prime_sc) << 5; 156 156 if (short_preamble) 157 157 reg_tmp |= 0x80; ··· 163 163 u8 min_spacing_to_set; 164 164 u8 sec_min_space; 165 165 166 - min_spacing_to_set = *((u8 *)val); 166 + min_spacing_to_set = *val; 167 167 if (min_spacing_to_set <= 7) { 168 168 if (rtlpriv->sec.pairwise_enc_algorithm == 169 169 NO_ENCRYPTION) ··· 194 194 case HW_VAR_SHORTGI_DENSITY:{ 195 195 u8 density_to_set; 196 196 197 - density_to_set = *((u8 *) val); 197 + density_to_set = *val; 198 198 mac->min_space_cfg = rtlpriv->rtlhal.minspace_cfg; 199 199 mac->min_space_cfg |= (density_to_set << 3); 200 200 ··· 216 216 15, 15, 15, 15, 0}; 217 217 u8 index = 0; 218 218 219 - factor_toset = *((u8 *) val); 219 + factor_toset = *val; 220 220 if (factor_toset <= 3) { 221 221 factor_toset = (1 << (factor_toset + 2)); 222 222 if (factor_toset > 0xf) ··· 248 248 break; 249 249 } 250 250 case HW_VAR_AC_PARAM:{ 251 - u8 e_aci = *((u8 *) val); 251 + u8 e_aci = *val; 252 252 rtl92s_dm_init_edca_turbo(hw); 253 253 254 254 if (rtlpci->acm_method != eAcmWay2_SW) 255 255 rtlpriv->cfg->ops->set_hw_reg(hw, 256 256 HW_VAR_ACM_CTRL, 257 - (u8 *)(&e_aci)); 257 + &e_aci); 258 258 break; 259 259 } 260 260 case HW_VAR_ACM_CTRL:{ 261 - u8 e_aci = *((u8 *) val); 261 + u8 e_aci = *val; 262 262 union aci_aifsn *p_aci_aifsn = (union aci_aifsn *)(&( 263 263 mac->ac[0].aifs)); 264 264 u8 acm = p_aci_aifsn->f.acm; ··· 313 313 break; 314 314 } 315 315 case HW_VAR_RETRY_LIMIT:{ 316 - u8 retry_limit = ((u8 *) (val))[0]; 316 + u8 retry_limit = val[0]; 317 317 318 318 rtl_write_word(rtlpriv, RETRY_LIMIT, 319 319 retry_limit << RETRY_LIMIT_SHORT_SHIFT | ··· 328 328 break; 329 329 } 330 330 case HW_VAR_EFUSE_USAGE: { 331 - rtlefuse->efuse_usedpercentage = *((u8 *) val); 331 + rtlefuse->efuse_usedpercentage = *val; 332 332 break; 333 333 } 334 334 case HW_VAR_IO_CMD: { 335 335 break; 336 336 } 337 337 case HW_VAR_WPA_CONFIG: { 338 - rtl_write_byte(rtlpriv, REG_SECR, *((u8 *) val)); 338 + rtl_write_byte(rtlpriv, REG_SECR, *val); 339 339 break; 340 340 } 341 341 case HW_VAR_SET_RPWM:{ ··· 1813 1813 else 1814 1814 index = 2; 1815 1815 1816 - tempval = (*(u8 *)&hwinfo[EEPROM_TX_PWR_HT20_DIFF + 1817 - index]) & 0xff; 1816 + tempval = hwinfo[EEPROM_TX_PWR_HT20_DIFF + index] & 0xff; 1818 1817 rtlefuse->txpwr_ht20diff[RF90_PATH_A][i] = (tempval & 0xF); 1819 1818 rtlefuse->txpwr_ht20diff[RF90_PATH_B][i] = 1820 1819 ((tempval >> 4) & 0xF); ··· 1829 1830 else 1830 1831 index = 1; 1831 1832 1832 - tempval = (*(u8 *)&hwinfo[EEPROM_TX_PWR_OFDM_DIFF + index]) 1833 - & 0xff; 1833 + tempval = hwinfo[EEPROM_TX_PWR_OFDM_DIFF + index] & 0xff; 1834 1834 rtlefuse->txpwr_legacyhtdiff[RF90_PATH_A][i] = 1835 1835 (tempval & 0xF); 1836 1836 rtlefuse->txpwr_legacyhtdiff[RF90_PATH_B][i] = 1837 1837 ((tempval >> 4) & 0xF); 1838 1838 1839 - tempval = (*(u8 *)&hwinfo[TX_PWR_SAFETY_CHK]); 1839 + tempval = hwinfo[TX_PWR_SAFETY_CHK]; 1840 1840 rtlefuse->txpwr_safetyflag = (tempval & 0x01); 1841 1841 } 1842 1842 ··· 1874 1876 1875 1877 /* Read RF-indication and Tx Power gain 1876 1878 * index diff of legacy to HT OFDM rate. */ 1877 - tempval = (*(u8 *)&hwinfo[EEPROM_RFIND_POWERDIFF]) & 0xff; 1879 + tempval = hwinfo[EEPROM_RFIND_POWERDIFF] & 0xff; 1878 1880 rtlefuse->eeprom_txpowerdiff = tempval; 1879 1881 rtlefuse->legacy_httxpowerdiff = 1880 1882 rtlefuse->txpwr_legacyhtdiff[RF90_PATH_A][0]; ··· 1885 1887 /* Get TSSI value for each path. */ 1886 1888 usvalue = *(u16 *)&hwinfo[EEPROM_TSSI_A]; 1887 1889 rtlefuse->eeprom_tssi[RF90_PATH_A] = (u8)((usvalue & 0xff00) >> 8); 1888 - usvalue = *(u8 *)&hwinfo[EEPROM_TSSI_B]; 1890 + usvalue = hwinfo[EEPROM_TSSI_B]; 1889 1891 rtlefuse->eeprom_tssi[RF90_PATH_B] = (u8)(usvalue & 0xff); 1890 1892 1891 1893 RTPRINT(rtlpriv, FINIT, INIT_TxPower, "TSSI_A = 0x%x, TSSI_B = 0x%x\n", ··· 1894 1896 1895 1897 /* Read antenna tx power offset of B/C/D to A from EEPROM */ 1896 1898 /* and read ThermalMeter from EEPROM */ 1897 - tempval = *(u8 *)&hwinfo[EEPROM_THERMALMETER]; 1899 + tempval = hwinfo[EEPROM_THERMALMETER]; 1898 1900 rtlefuse->eeprom_thermalmeter = tempval; 1899 1901 RTPRINT(rtlpriv, FINIT, INIT_TxPower, 1900 1902 "thermalmeter = 0x%x\n", rtlefuse->eeprom_thermalmeter); ··· 1904 1906 rtlefuse->tssi_13dbm = rtlefuse->eeprom_thermalmeter * 100; 1905 1907 1906 1908 /* Read CrystalCap from EEPROM */ 1907 - tempval = (*(u8 *)&hwinfo[EEPROM_CRYSTALCAP]) >> 4; 1909 + tempval = hwinfo[EEPROM_CRYSTALCAP] >> 4; 1908 1910 rtlefuse->eeprom_crystalcap = tempval; 1909 1911 /* CrystalCap, BIT(12)~15 */ 1910 1912 rtlefuse->crystalcap = rtlefuse->eeprom_crystalcap; 1911 1913 1912 1914 /* Read IC Version && Channel Plan */ 1913 1915 /* Version ID, Channel plan */ 1914 - rtlefuse->eeprom_channelplan = *(u8 *)&hwinfo[EEPROM_CHANNELPLAN]; 1916 + rtlefuse->eeprom_channelplan = hwinfo[EEPROM_CHANNELPLAN]; 1915 1917 rtlefuse->txpwr_fromeprom = true; 1916 1918 RTPRINT(rtlpriv, FINIT, INIT_TxPower, 1917 1919 "EEPROM ChannelPlan = 0x%4x\n", rtlefuse->eeprom_channelplan); 1918 1920 1919 1921 /* Read Customer ID or Board Type!!! */ 1920 - tempval = *(u8 *)&hwinfo[EEPROM_BOARDTYPE]; 1922 + tempval = hwinfo[EEPROM_BOARDTYPE]; 1921 1923 /* Change RF type definition */ 1922 1924 if (tempval == 0) 1923 1925 rtlphy->rf_type = RF_2T2R; ··· 1939 1941 } 1940 1942 } 1941 1943 rtlefuse->b1ss_support = rtlefuse->b1x1_recvcombine; 1942 - rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMID]; 1944 + rtlefuse->eeprom_oemid = *&hwinfo[EEPROM_CUSTOMID]; 1943 1945 1944 1946 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "EEPROM Customer ID: 0x%2x", 1945 1947 rtlefuse->eeprom_oemid); ··· 2249 2251 u16 sifs_timer; 2250 2252 2251 2253 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME, 2252 - (u8 *)&mac->slot_time); 2254 + &mac->slot_time); 2253 2255 sifs_timer = 0x0e0e; 2254 2256 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SIFS, (u8 *)&sifs_timer); 2255 2257
+1 -1
drivers/net/wireless/rtlwifi/rtl8192se/trx.c
··· 599 599 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 600 600 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 601 601 struct ieee80211_sta *sta = info->control.sta; 602 - u8 *pdesc = (u8 *) pdesc_tx; 602 + u8 *pdesc = pdesc_tx; 603 603 u16 seq_number; 604 604 __le16 fc = hdr->frame_control; 605 605 u8 reserved_macid = 0;
+1 -2
drivers/net/wireless/ti/wlcore/tx.c
··· 871 871 /* Called upon reception of a TX complete interrupt */ 872 872 void wl1271_tx_complete(struct wl1271 *wl) 873 873 { 874 - struct wl1271_acx_mem_map *memmap = 875 - (struct wl1271_acx_mem_map *)wl->target_mem_map; 874 + struct wl1271_acx_mem_map *memmap = wl->target_mem_map; 876 875 u32 count, fw_counter; 877 876 u32 i; 878 877
+1 -1
drivers/net/wireless/zd1211rw/zd_chip.h
··· 827 827 static inline int zd_ioread32_locked(struct zd_chip *chip, u32 *value, 828 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 833 833 static inline int zd_iowrite16_locked(struct zd_chip *chip, u16 value,
+1 -1
drivers/net/wireless/zd1211rw/zd_usb.h
··· 274 274 static inline int zd_usb_ioread16(struct zd_usb *usb, u16 *value, 275 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 280 280 void zd_usb_iowrite16v_async_start(struct zd_usb *usb);