Remove unnecessary conditions where if and else block had same code. Signed-off-by: Umang Parmar <umangjparmar@xxxxxxxxx> --- .../rtlwifi/btcoexist/halbtc8822b2ant.c | 6 ---- .../staging/rtlwifi/btcoexist/halbtcoutsrc.c | 6 ++-- drivers/staging/rtlwifi/phydm/phydm_debug.c | 29 ++++++------------- drivers/staging/rtlwifi/phydm/phydm_dig.c | 10 ++----- .../staging/rtlwifi/phydm/phydm_hwconfig.c | 4 +-- drivers/staging/rtlwifi/phydm/phydm_psd.c | 7 +---- 6 files changed, 16 insertions(+), 46 deletions(-) diff --git a/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c b/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c index 7e6071059a95..cfa194c77d5a 100644 --- a/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c +++ b/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c @@ -2696,12 +2696,6 @@ static void halbtc8822b2ant_action_hid(struct btc_coexist *btcoexist) NORMAL_EXEC, 4); halbtc8822b2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 108); - } else if (wifi_bw == 0) { /* if 11bg mode */ - - halbtc8822b2ant_coex_table_with_type(btcoexist, - NORMAL_EXEC, 8); - halbtc8822b2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, - 111); } else { halbtc8822b2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 8); diff --git a/drivers/staging/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/staging/rtlwifi/btcoexist/halbtcoutsrc.c index 4d1f9bf53c53..d01f83c21cce 100644 --- a/drivers/staging/rtlwifi/btcoexist/halbtcoutsrc.c +++ b/drivers/staging/rtlwifi/btcoexist/halbtcoutsrc.c @@ -484,10 +484,8 @@ static s32 halbtc_get_wifi_rssi(struct rtl_priv *rtlpriv) { int undec_sm_pwdb = 0; - if (rtlpriv->mac80211.link_state >= MAC80211_LINKED) - undec_sm_pwdb = rtlpriv->dm.undec_sm_pwdb; - else /* associated entry pwdb */ - undec_sm_pwdb = rtlpriv->dm.undec_sm_pwdb; + undec_sm_pwdb = rtlpriv->dm.undec_sm_pwdb; + return undec_sm_pwdb; } diff --git a/drivers/staging/rtlwifi/phydm/phydm_debug.c b/drivers/staging/rtlwifi/phydm/phydm_debug.c index b5b69d5f1a41..47ad19f35479 100644 --- a/drivers/staging/rtlwifi/phydm/phydm_debug.c +++ b/drivers/staging/rtlwifi/phydm/phydm_debug.c @@ -140,26 +140,15 @@ 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); } } diff --git a/drivers/staging/rtlwifi/phydm/phydm_dig.c b/drivers/staging/rtlwifi/phydm/phydm_dig.c index 3115e7bdc749..9c3574232f03 100644 --- a/drivers/staging/rtlwifi/phydm/phydm_dig.c +++ b/drivers/staging/rtlwifi/phydm/phydm_dig.c @@ -599,13 +599,9 @@ 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) { diff --git a/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c b/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c index 4bf86e5a451f..bf0af36ceb9e 100644 --- a/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c +++ b/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c @@ -1750,9 +1750,7 @@ 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 + else bw = ODM_BW20M; } diff --git a/drivers/staging/rtlwifi/phydm/phydm_psd.c b/drivers/staging/rtlwifi/phydm/phydm_psd.c index badc514ac0be..c93d871f1eb6 100644 --- a/drivers/staging/rtlwifi/phydm/phydm_psd.c +++ b/drivers/staging/rtlwifi/phydm/phydm_psd.c @@ -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 */ -- 2.18.0 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel