From: Aya Mahfouz Date: Wed, 4 Mar 2015 05:33:06 +0000 (+0200) Subject: staging: rtl8192u: remove extra parentheses around right bit shift operation X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9eb9e69536ba00d2dbe4f481b20ced67053a6c08;p=linux-beck.git 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: Aya Mahfouz Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 9de4412da3b3..bab7751a7636 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -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