staging: rtl8192u: remove extra parentheses around right bit shift operation
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Wed, 4 Mar 2015 05:33:06 +0000 (07:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Mar 2015 23:22:42 +0000 (15:22 -0800)
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: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/r8192U_core.c

index 9de4412da3b36f2721cc6ffa95b509ed17308d66..bab7751a7636d1563c3630d6a90ee28e035cb8b2 100644 (file)
@@ -2310,11 +2310,11 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
        }
 
        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_pid = eprom_read(dev, (EEPROM_PID>>1));
-               tmpValue = eprom_read(dev, (EEPROM_ChannelPlan>>1));
-               priv->eeprom_ChannelPlan = ((tmpValue&0xff00)>>8);
+               priv->eeprom_pid = eprom_read(dev, EEPROM_PID>>1);
+               tmpValue = eprom_read(dev, EEPROM_ChannelPlan>>1);
+               priv->eeprom_ChannelPlan = (tmpValue & 0xff00)>>8;
                priv->btxpowerdata_readfromEEPORM = true;
                priv->eeprom_CustomerID = eprom_read(dev, (EEPROM_Customer_ID>>1)) >>8;
        } else {
@@ -2397,7 +2397,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
                        }
                } else if (priv->EEPROM_Def_Ver == 1) {
                        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;
                        } else {
                                tmpValue = 0x10;
@@ -2410,7 +2411,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
                                tmpValue = 0x1010;
                        *((u16 *)(&priv->EEPROMTxPowerLevelCCK_V1[1])) = tmpValue;
                        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
                                tmpValue = 0x1010;
                        *((u16 *)(&priv->EEPROMTxPowerLevelOFDM24G[0])) = tmpValue;
@@ -2453,7 +2455,7 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
                // Antenna B gain offset to antenna A, bit0~3
                priv->AntennaTxPwDiff[0] = (priv->EEPROMTxPowerDiff & 0xf);
                // 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
                priv->CrystalCap = priv->EEPROMCrystalCap;
                // ThermalMeter, bit0~3 for RFIC1, bit4~7 for RFIC2