Commit 9eb9e695 authored by Aya Mahfouz's avatar Aya Mahfouz Committed by Greg Kroah-Hartman

staging: rtl8192u: remove extra parentheses around right bit shift operation

Removes extra parentheses around bitwise right shift operation.
The cases handled are when the resultant value is assigned to
a variable or when a shift operation is carried out for a function
argument. The issues were detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Some coding style issues were handled manually to avoid
checkpatch warnings and errors.
Signed-off-by: default avatarAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0c401c1d
...@@ -2310,11 +2310,11 @@ static void rtl8192_read_eeprom_info(struct net_device *dev) ...@@ -2310,11 +2310,11 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
} }
if (bLoad_From_EEPOM) { if (bLoad_From_EEPOM) {
tmpValue = eprom_read(dev, (EEPROM_VID>>1)); tmpValue = eprom_read(dev, EEPROM_VID>>1);
priv->eeprom_vid = endian_swap(&tmpValue); priv->eeprom_vid = endian_swap(&tmpValue);
priv->eeprom_pid = eprom_read(dev, (EEPROM_PID>>1)); priv->eeprom_pid = eprom_read(dev, EEPROM_PID>>1);
tmpValue = eprom_read(dev, (EEPROM_ChannelPlan>>1)); tmpValue = eprom_read(dev, EEPROM_ChannelPlan>>1);
priv->eeprom_ChannelPlan = ((tmpValue&0xff00)>>8); priv->eeprom_ChannelPlan = (tmpValue & 0xff00)>>8;
priv->btxpowerdata_readfromEEPORM = true; priv->btxpowerdata_readfromEEPORM = true;
priv->eeprom_CustomerID = eprom_read(dev, (EEPROM_Customer_ID>>1)) >>8; priv->eeprom_CustomerID = eprom_read(dev, (EEPROM_Customer_ID>>1)) >>8;
} else { } else {
...@@ -2397,7 +2397,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev) ...@@ -2397,7 +2397,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
} }
} else if (priv->EEPROM_Def_Ver == 1) { } else if (priv->EEPROM_Def_Ver == 1) {
if (bLoad_From_EEPOM) { if (bLoad_From_EEPOM) {
tmpValue = eprom_read(dev, (EEPROM_TxPwIndex_CCK_V1>>1)); tmpValue = eprom_read(dev,
EEPROM_TxPwIndex_CCK_V1 >> 1);
tmpValue = (tmpValue & 0xff00) >> 8; tmpValue = (tmpValue & 0xff00) >> 8;
} else { } else {
tmpValue = 0x10; tmpValue = 0x10;
...@@ -2410,7 +2411,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev) ...@@ -2410,7 +2411,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
tmpValue = 0x1010; tmpValue = 0x1010;
*((u16 *)(&priv->EEPROMTxPowerLevelCCK_V1[1])) = tmpValue; *((u16 *)(&priv->EEPROMTxPowerLevelCCK_V1[1])) = tmpValue;
if (bLoad_From_EEPOM) if (bLoad_From_EEPOM)
tmpValue = eprom_read(dev, (EEPROM_TxPwIndex_OFDM_24G_V1>>1)); tmpValue = eprom_read(dev,
EEPROM_TxPwIndex_OFDM_24G_V1 >> 1);
else else
tmpValue = 0x1010; tmpValue = 0x1010;
*((u16 *)(&priv->EEPROMTxPowerLevelOFDM24G[0])) = tmpValue; *((u16 *)(&priv->EEPROMTxPowerLevelOFDM24G[0])) = tmpValue;
...@@ -2453,7 +2455,7 @@ static void rtl8192_read_eeprom_info(struct net_device *dev) ...@@ -2453,7 +2455,7 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
// Antenna B gain offset to antenna A, bit0~3 // Antenna B gain offset to antenna A, bit0~3
priv->AntennaTxPwDiff[0] = (priv->EEPROMTxPowerDiff & 0xf); priv->AntennaTxPwDiff[0] = (priv->EEPROMTxPowerDiff & 0xf);
// Antenna C gain offset to antenna A, bit4~7 // Antenna C gain offset to antenna A, bit4~7
priv->AntennaTxPwDiff[1] = ((priv->EEPROMTxPowerDiff & 0xf0)>>4); priv->AntennaTxPwDiff[1] = (priv->EEPROMTxPowerDiff & 0xf0)>>4;
// CrystalCap, bit12~15 // CrystalCap, bit12~15
priv->CrystalCap = priv->EEPROMCrystalCap; priv->CrystalCap = priv->EEPROMCrystalCap;
// ThermalMeter, bit0~3 for RFIC1, bit4~7 for RFIC2 // ThermalMeter, bit0~3 for RFIC1, bit4~7 for RFIC2
......
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