mwifiex: Remove casts of pointer to same type
authorJoe Perches <joe@perches.com>
Mon, 24 Mar 2014 20:15:39 +0000 (13:15 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 27 Mar 2014 18:20:05 +0000 (14:20 -0400)
Casting a pointer to a pointer of the same type is pointless,
so remove these unnecessary casts.

Done via coccinelle script:

$ cat typecast_2.cocci
@@
type T;
T *foo;
@@

- (T *)foo
+ foo

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/pcie.c
drivers/net/wireless/mwifiex/scan.c
drivers/net/wireless/mwifiex/tdls.c

index 57c353a94b29784f990c7e62c5e8e2dd2bb36b46..7614a42f9c36dc0735803098a4882ce30e60eba3 100644 (file)
@@ -1033,7 +1033,7 @@ static int mwifiex_pcie_send_data_complete(struct mwifiex_adapter *adapter)
                card->tx_buf_list[wrdoneidx] = NULL;
 
                if (reg->pfu_enabled) {
-                       desc2 = (void *)card->txbd_ring[wrdoneidx];
+                       desc2 = card->txbd_ring[wrdoneidx];
                        memset(desc2, 0, sizeof(*desc2));
                } else {
                        desc = card->txbd_ring[wrdoneidx];
@@ -1118,7 +1118,7 @@ mwifiex_pcie_send_data(struct mwifiex_adapter *adapter, struct sk_buff *skb,
                card->tx_buf_list[wrindx] = skb;
 
                if (reg->pfu_enabled) {
-                       desc2 = (void *)card->txbd_ring[wrindx];
+                       desc2 = card->txbd_ring[wrindx];
                        desc2->paddr = buf_pa;
                        desc2->len = (u16)skb->len;
                        desc2->frag_len = (u16)skb->len;
@@ -1278,7 +1278,7 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter)
                card->rx_buf_list[rd_index] = skb_tmp;
 
                if (reg->pfu_enabled) {
-                       desc2 = (void *)card->rxbd_ring[rd_index];
+                       desc2 = card->rxbd_ring[rd_index];
                        desc2->paddr = buf_pa;
                        desc2->len = skb_tmp->len;
                        desc2->frag_len = skb_tmp->len;
index 0e8ca7bab3e753d9f73a6c297bd1face39b9bc3f..4e6e75c2de0cbdafe7b056c1bf6ded703edc4a67 100644 (file)
@@ -1653,7 +1653,7 @@ mwifiex_parse_single_response_buf(struct mwifiex_private *priv, u8 **bss_info,
        curr_bcn_bytes -= ETH_ALEN;
 
        if (!ext_scan) {
-               rssi = (s32) *(u8 *)current_ptr;
+               rssi = (s32) *current_ptr;
                rssi = (-rssi) * 100;           /* Convert dBm to mBm */
                current_ptr += sizeof(u8);
                curr_bcn_bytes -= sizeof(u8);
index 8cec6e4ba8c4345d3518c8a407c19145beb48dc5..97662a1ba58cf06a08ff3372f4808e5a0c7cbcd9 100644 (file)
@@ -730,13 +730,13 @@ void mwifiex_process_tdls_action_frame(struct mwifiex_private *priv,
 
        if (len < (sizeof(struct ethhdr) + 3))
                return;
-       if (*(u8 *)(buf + sizeof(struct ethhdr)) != WLAN_TDLS_SNAP_RFTYPE)
+       if (*(buf + sizeof(struct ethhdr)) != WLAN_TDLS_SNAP_RFTYPE)
                return;
-       if (*(u8 *)(buf + sizeof(struct ethhdr) + 1) != WLAN_CATEGORY_TDLS)
+       if (*(buf + sizeof(struct ethhdr) + 1) != WLAN_CATEGORY_TDLS)
                return;
 
        peer = buf + ETH_ALEN;
-       action = *(u8 *)(buf + sizeof(struct ethhdr) + 2);
+       action = *(buf + sizeof(struct ethhdr) + 2);
 
        /* just handle TDLS setup request/response/confirm */
        if (action > WLAN_TDLS_SETUP_CONFIRM)