staging: rtlwifi: Remove unnecessary conditions
authorMaya Nakamura <m.maya.nakamura@gmail.com>
Wed, 31 Oct 2018 21:09:15 +0000 (14:09 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Nov 2018 13:53:58 +0000 (14:53 +0100)
Remove conditions with no effect. Issues found by Coccinelle's semantic
patch results for cond_no_effect.cocci. Eliminate checkpatch result, a
line should not end with a parenthesis.

Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtlwifi/phydm/phydm_debug.c
drivers/staging/rtlwifi/phydm/phydm_dig.c
drivers/staging/rtlwifi/phydm/phydm_hwconfig.c
drivers/staging/rtlwifi/phydm/phydm_psd.c

index b5b69d5f1a410cccf83c78254f0c18eb6182f2a1..1c7faa5840f2f95a4d6edee45b077c73c1fb5c13 100644 (file)
@@ -140,26 +140,17 @@ static inline void phydm_print_csi(struct phy_dm_struct *dm, u32 used,
                dword_h = odm_get_bb_reg(dm, 0xF74, MASKDWORD);
                dword_l = odm_get_bb_reg(dm, 0xF5C, MASKDWORD);
 
-               if (index % 2 == 0)
-                       PHYDM_SNPRINTF(
-                               output + used, out_len - used,
-                               "%02x  %02x  %02x  %02x  %02x  %02x  %02x  %02x\n",
-                               dword_l & MASKBYTE0, (dword_l & MASKBYTE1) >> 8,
-                               (dword_l & MASKBYTE2) >> 16,
-                               (dword_l & MASKBYTE3) >> 24,
-                               dword_h & MASKBYTE0, (dword_h & MASKBYTE1) >> 8,
-                               (dword_h & MASKBYTE2) >> 16,
-                               (dword_h & MASKBYTE3) >> 24);
-               else
-                       PHYDM_SNPRINTF(
-                               output + used, out_len - used,
-                               "%02x  %02x  %02x  %02x  %02x  %02x  %02x  %02x\n",
-                               dword_l & MASKBYTE0, (dword_l & MASKBYTE1) >> 8,
-                               (dword_l & MASKBYTE2) >> 16,
-                               (dword_l & MASKBYTE3) >> 24,
-                               dword_h & MASKBYTE0, (dword_h & MASKBYTE1) >> 8,
-                               (dword_h & MASKBYTE2) >> 16,
-                               (dword_h & MASKBYTE3) >> 24);
+               PHYDM_SNPRINTF(output + used,
+                              out_len - used,
+                              "%02x  %02x  %02x  %02x  %02x  %02x  %02x  %02x\n",
+                              dword_l & MASKBYTE0,
+                              (dword_l & MASKBYTE1) >> 8,
+                              (dword_l & MASKBYTE2) >> 16,
+                              (dword_l & MASKBYTE3) >> 24,
+                              dword_h & MASKBYTE0,
+                              (dword_h & MASKBYTE1) >> 8,
+                              (dword_h & MASKBYTE2) >> 16,
+                              (dword_h & MASKBYTE3) >> 24);
        }
 }
 
index f10776fbe2d93bd1290b729396ac7814270afca1..99c805cc380be02df315e693c8396f7b471e3f14 100644 (file)
@@ -599,13 +599,8 @@ void odm_dig_init(void *dm_void)
                       (DM_DIG_MAX_PAUSE_TYPE + 1));
        dig_tab->pause_cckpd_level = 0;
 
-       if (dm->board_type & (ODM_BOARD_EXT_PA | ODM_BOARD_EXT_LNA)) {
-               dig_tab->rx_gain_range_max = DM_DIG_MAX_NIC;
-               dig_tab->rx_gain_range_min = DM_DIG_MIN_NIC;
-       } else {
-               dig_tab->rx_gain_range_max = DM_DIG_MAX_NIC;
-               dig_tab->rx_gain_range_min = DM_DIG_MIN_NIC;
-       }
+       dig_tab->rx_gain_range_max = DM_DIG_MAX_NIC;
+       dig_tab->rx_gain_range_min = DM_DIG_MIN_NIC;
 
        dig_tab->enable_adjust_big_jump = 1;
        if (dm->support_ic_type & ODM_RTL8822B) {
index e1544e38944b834b4907b3ef2de6129f60cee78a..e7dcb5b02ad44e6cc5caae3696ad60830b6aa584 100644 (file)
@@ -1719,8 +1719,6 @@ static void phydm_get_rx_phy_status_type2(struct phy_dm_struct *dm,
                                          ODM_RTL8710B)) { /* JJ ADD 20161014 */
                if (rxsc == 3)
                        bw = ODM_BW40M;
-               else if ((rxsc == 1) || (rxsc == 2))
-                       bw = ODM_BW20M;
                else
                        bw = ODM_BW20M;
        }
index badc514ac0beae21583287956c6309c068cc2d15..c93d871f1eb65955a566f68fb37cf409988fc95d 100644 (file)
@@ -336,12 +336,7 @@ void phydm_psd_init(void *dm_void)
                        2; /*2b'11: 20MHz, 2b'10: 40MHz, 2b'01: 80MHz */
        }
 
-       if (dm->support_ic_type == ODM_RTL8812)
-               dm_psd_table->psd_pwr_common_offset = 0;
-       else if (dm->support_ic_type == ODM_RTL8821)
-               dm_psd_table->psd_pwr_common_offset = 0;
-       else
-               dm_psd_table->psd_pwr_common_offset = 0;
+       dm_psd_table->psd_pwr_common_offset = 0;
 
        phydm_psd_para_setting(dm, 1, 2, 3, 128, 0, 0, 7, 0);
        /*phydm_psd(dm, 0x3c, 0, 127);*/ /* target at -50dBm */