summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8192e
diff options
context:
space:
mode:
authorGargi Sharma <gs051095@gmail.com>2017-03-09 00:15:49 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-09 18:18:20 +0100
commit4db665e50ccc75ee64eb3ccdf53850956a83cbb6 (patch)
treed1fba7b1f7a4aebd24d5e3ff7fd6fae98a146cd4 /drivers/staging/rtl8192e
parent1f9f72f46aaa33f2935c6e31a5a91e75b4908ff6 (diff)
staging: rtl8192e: Remove useless type conversion
Some type conversions like casting a pointer/non-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: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192e')
-rw-r--r--drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index 8d6bca61e7aa..c3c56e213f36 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -135,7 +135,7 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val)
{
u32 RegRCR, Type;
- Type = ((u8 *)(val))[0];
+ Type = val[0];
RegRCR = rtl92e_readl(dev, RCR);
priv->ReceiveConfig = RegRCR;
@@ -161,7 +161,7 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val)
{
u32 regTmp;
- priv->short_preamble = (bool)(*(u8 *)val);
+ priv->short_preamble = (bool)*val;
regTmp = priv->basic_rate;
if (priv->short_preamble)
regTmp |= BRSR_AckShortPmb;
@@ -175,7 +175,7 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val)
case HW_VAR_AC_PARAM:
{
- u8 pAcParam = *((u8 *)val);
+ u8 pAcParam = *val;
u32 eACI = pAcParam;
u8 u1bAIFS;
u32 u4bAcParam;
@@ -221,7 +221,7 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val)
break;
}
priv->rtllib->SetHwRegHandler(dev, HW_VAR_ACM_CTRL,
- (u8 *)(&pAcParam));
+ &pAcParam);
break;
}
@@ -229,7 +229,7 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val)
{
struct rtllib_qos_parameters *qos_parameters =
&priv->rtllib->current_network.qos_data.parameters;
- u8 pAcParam = *((u8 *)val);
+ u8 pAcParam = *val;
u32 eACI = pAcParam;
union aci_aifsn *pAciAifsn = (union aci_aifsn *) &
(qos_parameters->aifs[0]);
@@ -293,7 +293,7 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val)
case HW_VAR_RF_TIMING:
{
- u8 Rf_Timing = *((u8 *)val);
+ u8 Rf_Timing = *val;
rtl92e_writeb(dev, rFPGA0_RFTiming1, Rf_Timing);
break;
@@ -372,7 +372,7 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
if (!priv->AutoloadFailFlag) {
for (i = 0; i < 6; i += 2) {
usValue = rtl92e_eeprom_read(dev,
- (u16)((EEPROM_NODE_ADDRESS_BYTE_0 + i) >> 1));
+ (EEPROM_NODE_ADDRESS_BYTE_0 + i) >> 1);
*(u16 *)(&dev->dev_addr[i]) = usValue;
}
} else {
@@ -436,8 +436,7 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
for (i = 0; i < 14; i += 2) {
if (!priv->AutoloadFailFlag)
usValue = rtl92e_eeprom_read(dev,
- (u16)((EEPROM_TxPwIndex_CCK +
- i) >> 1));
+ (EEPROM_TxPwIndex_CCK + i) >> 1);
else
usValue = EEPROM_Default_TxPower;
*((u16 *)(&priv->EEPROMTxPowerLevelCCK[i])) =
@@ -452,8 +451,7 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
for (i = 0; i < 14; i += 2) {
if (!priv->AutoloadFailFlag)
usValue = rtl92e_eeprom_read(dev,
- (u16)((EEPROM_TxPwIndex_OFDM_24G
- + i) >> 1));
+ (EEPROM_TxPwIndex_OFDM_24G + i) >> 1);
else
usValue = EEPROM_Default_TxPower;
*((u16 *)(&priv->EEPROMTxPowerLevelOFDM24G[i]))
@@ -1650,15 +1648,11 @@ static void _rtl92e_query_rxphystatus(
evm = rtl92e_evm_db_to_percent(rx_evmX);
if (bpacket_match_bssid) {
if (i == 0) {
- pstats->SignalQuality = (u8)(evm &
- 0xff);
- precord_stats->SignalQuality = (u8)(evm
- & 0xff);
+ pstats->SignalQuality = evm & 0xff;
+ precord_stats->SignalQuality = evm & 0xff;
}
- pstats->RxMIMOSignalQuality[i] = (u8)(evm &
- 0xff);
- precord_stats->RxMIMOSignalQuality[i] = (u8)(evm
- & 0xff);
+ pstats->RxMIMOSignalQuality[i] = evm & 0xff;
+ precord_stats->RxMIMOSignalQuality[i] = evm & 0xff;
}
}