Commit efdcb35a authored by Bhumika Goyal's avatar Bhumika Goyal Committed by Greg Kroah-Hartman

Staging: rtl8192u: Remove useless type conversion

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: default avatarBhumika Goyal <bhumirks@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 182eec0e
...@@ -1027,7 +1027,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -1027,7 +1027,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
ieee, ieee,
(PTS_COMMON_INFO *) &pRxTS, (PTS_COMMON_INFO *) &pRxTS,
hdr->addr2, hdr->addr2,
(u8)Frame_QoSTID((u8 *)(skb->data)), Frame_QoSTID((u8 *)(skb->data)),
RX_DIR, RX_DIR,
true)) true))
{ {
......
...@@ -806,7 +806,7 @@ static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d ...@@ -806,7 +806,7 @@ static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
*(tag++) = 2; *(tag++) = 2;
put_unaligned_le16(ieee->current_network.atim_window, put_unaligned_le16(ieee->current_network.atim_window,
(u8 *)tag); tag);
tag+=2; tag+=2;
} }
......
...@@ -354,7 +354,7 @@ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb) ...@@ -354,7 +354,7 @@ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb)
req = (struct rtl_80211_hdr_3addr *) skb->data; req = (struct rtl_80211_hdr_3addr *) skb->data;
tag = (u8 *)req; tag = (u8 *)req;
dst = (u8 *)(&req->addr2[0]); dst = &req->addr2[0];
tag += sizeof(struct rtl_80211_hdr_3addr); tag += sizeof(struct rtl_80211_hdr_3addr);
pDialogToken = tag + 2; //category+action pDialogToken = tag + 2; //category+action
pBaParamSet = (PBA_PARAM_SET)(tag + 3); //+DialogToken pBaParamSet = (PBA_PARAM_SET)(tag + 3); //+DialogToken
...@@ -452,7 +452,7 @@ int ieee80211_rx_ADDBARsp(struct ieee80211_device *ieee, struct sk_buff *skb) ...@@ -452,7 +452,7 @@ int ieee80211_rx_ADDBARsp(struct ieee80211_device *ieee, struct sk_buff *skb)
} }
rsp = (struct rtl_80211_hdr_3addr *)skb->data; rsp = (struct rtl_80211_hdr_3addr *)skb->data;
tag = (u8 *)rsp; tag = (u8 *)rsp;
dst = (u8 *)(&rsp->addr2[0]); dst = &rsp->addr2[0];
tag += sizeof(struct rtl_80211_hdr_3addr); tag += sizeof(struct rtl_80211_hdr_3addr);
pDialogToken = tag + 2; pDialogToken = tag + 2;
pStatusCode = (u16 *)(tag + 3); pStatusCode = (u16 *)(tag + 3);
...@@ -590,7 +590,7 @@ int ieee80211_rx_DELBA(struct ieee80211_device *ieee, struct sk_buff *skb) ...@@ -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); IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len);
delba = (struct rtl_80211_hdr_3addr *)skb->data; delba = (struct rtl_80211_hdr_3addr *)skb->data;
dst = (u8 *)(&delba->addr2[0]); dst = &delba->addr2[0];
pDelBaParamSet = (PDELBA_PARAM_SET)&delba->payload[2]; pDelBaParamSet = (PDELBA_PARAM_SET)&delba->payload[2];
if(pDelBaParamSet->field.Initiator == 1) if(pDelBaParamSet->field.Initiator == 1)
......
...@@ -4472,10 +4472,10 @@ static void rtl8192_query_rxphystatus(struct r8192_priv *priv, ...@@ -4472,10 +4472,10 @@ static void rtl8192_query_rxphystatus(struct r8192_priv *priv,
*/ */
pstats->SignalQuality = pstats->SignalQuality =
precord_stats->SignalQuality = precord_stats->SignalQuality =
(u8)(evm & 0xff); evm & 0xff;
pstats->RxMIMOSignalQuality[i] = pstats->RxMIMOSignalQuality[i] =
precord_stats->RxMIMOSignalQuality[i] = precord_stats->RxMIMOSignalQuality[i] =
(u8)(evm & 0xff); evm & 0xff;
} }
...@@ -5010,8 +5010,7 @@ static int rtl8192_usb_probe(struct usb_interface *intf, ...@@ -5010,8 +5010,7 @@ static int rtl8192_usb_probe(struct usb_interface *intf,
dev->netdev_ops = &rtl8192_netdev_ops; dev->netdev_ops = &rtl8192_netdev_ops;
dev->wireless_handlers = dev->wireless_handlers = &r8192_wx_handlers_def;
(struct iw_handler_def *)&r8192_wx_handlers_def;
dev->type = ARPHRD_ETHER; dev->type = ARPHRD_ETHER;
...@@ -5219,7 +5218,8 @@ void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, ...@@ -5219,7 +5218,8 @@ void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType,
} else { } else {
/* Key Material */ /* Key Material */
if (KeyContent) { 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); write_nic_dword(dev, RWCAM, TargetCommand);
} }
} }
......
...@@ -150,7 +150,7 @@ void deinit_hal_dm(struct net_device *dev) ...@@ -150,7 +150,7 @@ void deinit_hal_dm(struct net_device *dev)
#ifdef USB_RX_AGGREGATION_SUPPORT #ifdef USB_RX_AGGREGATION_SUPPORT
void dm_CheckRxAggregation(struct net_device *dev) 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; PRT_HIGH_THROUGHPUT pHTInfo = priv->ieee80211->pHTInfo;
static unsigned long lastTxOkCnt; static unsigned long lastTxOkCnt;
static unsigned long lastRxOkCnt; static unsigned long lastRxOkCnt;
...@@ -2346,7 +2346,7 @@ static void dm_check_edca_turbo( ...@@ -2346,7 +2346,7 @@ static void dm_check_edca_turbo(
static void dm_init_ctstoself(struct net_device *dev) 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->bCTSToSelfEnable = true;
priv->ieee80211->CTSToSelfTH = CTSToSelfTHVal; priv->ieee80211->CTSToSelfTH = CTSToSelfTHVal;
...@@ -2354,7 +2354,7 @@ static void dm_init_ctstoself(struct net_device *dev) ...@@ -2354,7 +2354,7 @@ static void dm_init_ctstoself(struct net_device *dev)
static void dm_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; PRT_HIGH_THROUGHPUT pHTInfo = priv->ieee80211->pHTInfo;
static unsigned long lastTxOkCnt; static unsigned long lastTxOkCnt;
static unsigned long lastRxOkCnt; static unsigned long lastRxOkCnt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment