Staging: rtl8192u: Remove useless type conversion
authorBhumika Goyal <bhumirks@gmail.com>
Sun, 18 Sep 2016 12:26:24 +0000 (17:56 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Sep 2016 11:35:45 +0000 (13:35 +0200)
Some type conversions like casting a pointer to a pointer of same type,
casting to the original type using addressof(&) operator etc. are not
needed. Therefore, remove them. Done using coccinelle:

@@
type t;
t *p;
t a;
@@
(
- (t)(a)
+ a
|
- (t *)(p)
+ p
|
- (t *)(&a)
+ &a
)

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
drivers/staging/rtl8192u/r8192U_core.c
drivers/staging/rtl8192u/r8192U_dm.c

index 051c2be842d0ad84382701b175b0843153d0a58c..89cbc077a48d896b016df1bc3ed29336ca6ef10d 100644 (file)
@@ -1027,7 +1027,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
                                ieee,
                                (PTS_COMMON_INFO *) &pRxTS,
                                hdr->addr2,
-                               (u8)Frame_QoSTID((u8 *)(skb->data)),
+                               Frame_QoSTID((u8 *)(skb->data)),
                                RX_DIR,
                                true))
                {
index 49db1b75cd05a0c7936df55add4dcce71cbb61d9..10a8040da8aabc0c1449af57ff478377896bff6d 100644 (file)
@@ -806,7 +806,7 @@ static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
                *(tag++) = 2;
 
                put_unaligned_le16(ieee->current_network.atim_window,
-                                  (u8 *)tag);
+                                  tag);
                tag+=2;
        }
 
index 28737ec65186a2d940fd71bf256c030eace574f7..98fbb6ef484df2183b88f71a706f9d93d13afacc 100644 (file)
@@ -354,7 +354,7 @@ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb)
 
        req = (struct rtl_80211_hdr_3addr *) skb->data;
        tag = (u8 *)req;
-       dst = (u8 *)(&req->addr2[0]);
+       dst = &req->addr2[0];
        tag += sizeof(struct rtl_80211_hdr_3addr);
        pDialogToken = tag + 2;  //category+action
        pBaParamSet = (PBA_PARAM_SET)(tag + 3);   //+DialogToken
@@ -452,7 +452,7 @@ int ieee80211_rx_ADDBARsp(struct ieee80211_device *ieee, struct sk_buff *skb)
        }
        rsp = (struct rtl_80211_hdr_3addr *)skb->data;
        tag = (u8 *)rsp;
-       dst = (u8 *)(&rsp->addr2[0]);
+       dst = &rsp->addr2[0];
        tag += sizeof(struct rtl_80211_hdr_3addr);
        pDialogToken = tag + 2;
        pStatusCode = (u16 *)(tag + 3);
@@ -590,7 +590,7 @@ int ieee80211_rx_DELBA(struct ieee80211_device *ieee, struct sk_buff *skb)
 
        IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len);
        delba = (struct rtl_80211_hdr_3addr *)skb->data;
-       dst = (u8 *)(&delba->addr2[0]);
+       dst = &delba->addr2[0];
        pDelBaParamSet = (PDELBA_PARAM_SET)&delba->payload[2];
 
        if(pDelBaParamSet->field.Initiator == 1)
index cdb64e3e0d18ee38887b3d07f12c902159df655d..c66e7cf608c0d3777f6a27db4510486588edf82c 100644 (file)
@@ -4472,10 +4472,10 @@ static void rtl8192_query_rxphystatus(struct r8192_priv *priv,
                                 */
                                pstats->SignalQuality =
                                        precord_stats->SignalQuality =
-                                       (u8)(evm & 0xff);
+                                       evm & 0xff;
                        pstats->RxMIMOSignalQuality[i] =
                                precord_stats->RxMIMOSignalQuality[i] =
-                               (u8)(evm & 0xff);
+                               evm & 0xff;
                }
 
 
@@ -5010,8 +5010,7 @@ static int rtl8192_usb_probe(struct usb_interface *intf,
 
        dev->netdev_ops = &rtl8192_netdev_ops;
 
-       dev->wireless_handlers =
-               (struct iw_handler_def *)&r8192_wx_handlers_def;
+       dev->wireless_handlers = &r8192_wx_handlers_def;
 
        dev->type = ARPHRD_ETHER;
 
@@ -5219,7 +5218,8 @@ void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType,
                } else {
                        /* Key Material */
                        if (KeyContent) {
-                               write_nic_dword(dev, WCAMI, (u32)(*(KeyContent + i - 2)));
+                               write_nic_dword(dev, WCAMI,
+                                               *(KeyContent + i - 2));
                                write_nic_dword(dev, RWCAM, TargetCommand);
                        }
                }
index 1e0e53c9c314051d73fa71ddbf7326302fa3ad8a..9209aad0515e294b3caad6c4984c40642bdba6d4 100644 (file)
@@ -150,7 +150,7 @@ void deinit_hal_dm(struct net_device *dev)
 #ifdef USB_RX_AGGREGATION_SUPPORT
 void dm_CheckRxAggregation(struct net_device *dev)
 {
-       struct r8192_priv *priv = ieee80211_priv((struct net_device *)dev);
+       struct r8192_priv *priv = ieee80211_priv(dev);
        PRT_HIGH_THROUGHPUT     pHTInfo = priv->ieee80211->pHTInfo;
        static unsigned long    lastTxOkCnt;
        static unsigned long    lastRxOkCnt;
@@ -2346,7 +2346,7 @@ dm_CheckEdcaTurbo_EXIT:
 
 static void dm_init_ctstoself(struct net_device *dev)
 {
-       struct r8192_priv *priv = ieee80211_priv((struct net_device *)dev);
+       struct r8192_priv *priv = ieee80211_priv(dev);
 
        priv->ieee80211->bCTSToSelfEnable = true;
        priv->ieee80211->CTSToSelfTH = CTSToSelfTHVal;
@@ -2354,7 +2354,7 @@ static void dm_init_ctstoself(struct net_device *dev)
 
 static void dm_ctstoself(struct net_device *dev)
 {
-       struct r8192_priv *priv = ieee80211_priv((struct net_device *)dev);
+       struct r8192_priv *priv = ieee80211_priv(dev);
        PRT_HIGH_THROUGHPUT     pHTInfo = priv->ieee80211->pHTInfo;
        static unsigned long                            lastTxOkCnt;
        static unsigned long                            lastRxOkCnt;