staging: rtl8188eu: remove extra parentheses around right bit shift operations
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Wed, 4 Mar 2015 05:31:56 +0000 (07:31 +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 operations.
The cases handled here are when resultant values are assigned to
variables. The issue was 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
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_efuse.c
drivers/staging/rtl8188eu/hal/odm.c
drivers/staging/rtl8188eu/hal/odm_HWConfig.c
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c

index 8816d11..defec6b 100644 (file)
@@ -139,7 +139,7 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8  *pbuf)
        while ((rtemp8 != 0xFF) && (eFuse_Addr < EFUSE_REAL_CONTENT_LEN_88E)) {
                /*  Check PG header for section num. */
                if ((rtemp8 & 0x1F) == 0x0F) {          /* extended header */
-                       u1temp = ((rtemp8 & 0xE0) >> 5);
+                       u1temp = (rtemp8 & 0xE0) >> 5;
                        rtemp8 = *(phymap+eFuse_Addr);
                        if ((rtemp8 & 0x0F) == 0x0F) {
                                eFuse_Addr++;
index 06477e8..28b5e7b 100644 (file)
@@ -741,13 +741,13 @@ void odm_FalseAlarmCounterStatistics(struct odm_dm_struct *pDM_Odm)
 
        ret_value = phy_query_bb_reg(adapter, ODM_REG_OFDM_FA_TYPE1_11N, bMaskDWord);
        FalseAlmCnt->Cnt_Fast_Fsync = (ret_value&0xffff);
-       FalseAlmCnt->Cnt_SB_Search_fail = ((ret_value&0xffff0000)>>16);
+       FalseAlmCnt->Cnt_SB_Search_fail = (ret_value & 0xffff0000)>>16;
        ret_value = phy_query_bb_reg(adapter, ODM_REG_OFDM_FA_TYPE2_11N, bMaskDWord);
        FalseAlmCnt->Cnt_OFDM_CCA = (ret_value&0xffff);
-       FalseAlmCnt->Cnt_Parity_Fail = ((ret_value&0xffff0000)>>16);
+       FalseAlmCnt->Cnt_Parity_Fail = (ret_value & 0xffff0000)>>16;
        ret_value = phy_query_bb_reg(adapter, ODM_REG_OFDM_FA_TYPE3_11N, bMaskDWord);
        FalseAlmCnt->Cnt_Rate_Illegal = (ret_value&0xffff);
-       FalseAlmCnt->Cnt_Crc8_fail = ((ret_value&0xffff0000)>>16);
+       FalseAlmCnt->Cnt_Crc8_fail = (ret_value & 0xffff0000)>>16;
        ret_value = phy_query_bb_reg(adapter, ODM_REG_OFDM_FA_TYPE4_11N, bMaskDWord);
        FalseAlmCnt->Cnt_Mcs_fail = (ret_value&0xffff);
 
@@ -757,7 +757,7 @@ void odm_FalseAlarmCounterStatistics(struct odm_dm_struct *pDM_Odm)
 
        ret_value = phy_query_bb_reg(adapter, ODM_REG_SC_CNT_11N, bMaskDWord);
        FalseAlmCnt->Cnt_BW_LSC = (ret_value&0xffff);
-       FalseAlmCnt->Cnt_BW_USC = ((ret_value&0xffff0000)>>16);
+       FalseAlmCnt->Cnt_BW_USC = (ret_value & 0xffff0000)>>16;
 
        /* hold cck counter */
        phy_set_bb_reg(adapter, ODM_REG_CCK_FA_RST_11N, BIT12, 1);
index 29f87df..f8fae18 100644 (file)
@@ -123,7 +123,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
                /* 2011.11.28 LukeLee: 88E use different LNA & VGA gain table */
                /* The RSSI formula should be modified according to the gain table */
                /* In 88E, cck_highpwr is always set to 1 */
-               LNA_idx = ((cck_agc_rpt & 0xE0) >> 5);
+               LNA_idx = (cck_agc_rpt & 0xE0) >> 5;
                VGA_idx = (cck_agc_rpt & 0x1F);
                switch (LNA_idx) {
                case 7:
index 3222d8d..7904d22 100644 (file)
@@ -596,7 +596,8 @@ void Hal_EfuseParseBoardType88E(struct adapter *pAdapter, u8 *hwinfo, bool AutoL
        struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
 
        if (!AutoLoadFail)
-               pHalData->BoardType = ((hwinfo[EEPROM_RF_BOARD_OPTION_88E]&0xE0)>>5);
+               pHalData->BoardType = (hwinfo[EEPROM_RF_BOARD_OPTION_88E]
+                                       & 0xE0) >> 5;
        else
                pHalData->BoardType = 0;
        DBG_88E("Board Type: 0x%2x\n", pHalData->BoardType);