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 8816d116a8b8d641032602c23eaf0ffe8f70e9b9..defec6b7883d09e48f8658bc893827c614f4d303 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 06477e8346535cd60a50ebba8e08c74406e62cef..28b5e7bd4fc0223beddd07102ce3d116bf0b116b 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 29f87dffbad374857a9ea755afc76e9b5f61abfb..f8fae18341faf28bf63a7d669a43e88400bc3ff4 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 3222d8d08b5b2d306ebf1e94ef5d8436c00e6e67..7904d2260f2cfd6b0f0e2eafeb1727ddab5683e7 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);