staging: rtlwifi: Remove unnecessary conditions and other cleanup
cover staging: rtlwifi: Remove unnecessary conditions and other cleanup
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. Edit statements to keep expressions on one line--one from Julia's feedback.
Maya Nakamura (2):
staging: rtlwifi: Remove unnecessary conditions
staging: rtlwifi: Keep expressions on one line
drivers/staging/rtlwifi/phydm/phydm_debug.c | 35 +++++++------------ drivers/staging/rtlwifi/phydm/phydm_dig.c | 9 ++--- .../staging/rtlwifi/phydm/phydm_hwconfig.c | 6 ++-- drivers/staging/rtlwifi/phydm/phydm_psd.c | 7 +--- 4 files changed, 17 insertions(+), 40 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/2 staging: rtlwifi: Remove unnecessary conditions
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.
--- drivers/staging/rtlwifi/phydm/phydm_debug.c | 31 +++++++------------ drivers/staging/rtlwifi/phydm/phydm_dig.c | 9 ++---- .../staging/rtlwifi/phydm/phydm_hwconfig.c | 2 -- drivers/staging/rtlwifi/phydm/phydm_psd.c | 7 +---- 4 files changed, 14 insertions(+), 35 deletions(-)
drivers/staging/rtlwifi/phydm/phydm_debug.c +11 -20
@@ -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 ); } }
drivers/staging/rtlwifi/phydm/phydm_dig.c +2 -7
@@ -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 ) {
drivers/staging/rtlwifi/phydm/phydm_hwconfig.c +0 -2
@@ -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 ; }
drivers/staging/rtlwifi/phydm/phydm_psd.c +1 -6
@@ -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 */
Signature · 1 line
2.17.1
PATCH 2/2 staging: rtlwifi: Keep expressions on one line
In reply to Maya NakamuraEdit two statements to keep expressions on one line--one from Julia's feedback.
--- drivers/staging/rtlwifi/phydm/phydm_debug.c | 4 +--- drivers/staging/rtlwifi/phydm/phydm_hwconfig.c | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-)
drivers/staging/rtlwifi/phydm/phydm_debug.c +1 -3
@@ -159,9 +159,7 @@ void phydm_init_debug_setting(struct phy_dm_struct *dm) dm->debug_level =ODM_DBG_TRACE ; dm->fw_debug_components =0 ; - dm->debug_components = - -0 ; + dm->debug_components =0 ; dm->fw_buff_is_enpty = true; dm->pre_c2h_seq =0 ;
drivers/staging/rtlwifi/phydm/phydm_hwconfig.c +2 -2
@@ -45,8 +45,8 @@ static u32 phydm_process_rssi_pwdb(struct phy_dm_struct *dm,u32 weighting =0 , undecorated_smoothed_pwdb;/* 2011.07.28 LukeLee: modified to prevent unstable CCK RSSI */ -if (entry->rssi_stat.ofdm_pkt == -64 ) {/* speed up when all packets are OFDM*/ +if (entry->rssi_stat.ofdm_pkt ==64 ) { +/* speed up when all packets are OFDM*/ undecorated_smoothed_pwdb = undecorated_smoothed_ofdm; ODM_RT_TRACE(dm, ODM_COMP_RSSI_MONITOR, "PWDB_0[%d] = (( %d ))\n", pktinfo->station_id,
Signature · 1 line
2.17.1
Re: [Outreachy kernel] [PATCH 2/2] staging: rtlwifi: Keep expressions on one line
Quoted 29 lines · Maya Nakamura
Edit two statements to keep expressions on one line--one from Julia's feedback.
Signed-off-by Maya Nakamura <[email protected]>--- drivers/staging/rtlwifi/phydm/phydm_debug.c | 4 +--- drivers/staging/rtlwifi/phydm/phydm_hwconfig.c | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-)drivers/staging/rtlwifi/phydm/phydm_debug.c +1
-3@@ -159,9 +159,7 @@ void phydm_init_debug_setting(struct phy_dm_struct *dm) dm->debug_level =ODM_DBG_TRACE ; dm->fw_debug_components =0 ; - dm->debug_components = - -0 ; + dm->debug_components =0 ; dm->fw_buff_is_enpty = true; dm->pre_c2h_seq =0 ;drivers/staging/rtlwifi/phydm/phydm_hwconfig.c +0
-0
drivers/staging/rtlwifi/phydm/phydm_hwconfig.c static u32 phydm_process_rssi_pwdb(struct phy_dm_struct *dm, · line 49
Quoted 7 lines
drivers/staging/rtlwifi/phydm/phydm_hwconfig.c +2
-2@@ -45,8 +45,8 @@ static u32 phydm_process_rssi_pwdb(struct phy_dm_struct *dm,u32 weighting =0 , undecorated_smoothed_pwdb;/* 2011.07.28 LukeLee: modified to prevent unstable CCK RSSI */ -if (entry->rssi_stat.ofdm_pkt == -64 ) {/* speed up when all packets are OFDM*/ +if (entry->rssi_stat.ofdm_pkt ==64 ) { +/* speed up when all packets are OFDM*/
There is another small cleanup you could do here, to put a space in front of the */
julia
Quoted 13 lines
drivers/staging/rtlwifi/phydm/phydm_hwconfig.c +0
-1undecorated_smoothed_pwdb = undecorated_smoothed_ofdm; ODM_RT_TRACE(dm, ODM_COMP_RSSI_MONITOR, "PWDB_0[%d] = (( %d ))\n", pktinfo->station_id, --2.17.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/368f5b749807cd02336274f978f3c6451655583d.1540968891.git.m.maya.nakamura%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Re: [Outreachy kernel] [PATCH 2/2] staging: rtlwifi: Keep expressions on one line
Quoted 44 lines · Julia Lawall
Quoted 29 lines · Maya Nakamura
Edit two statements to keep expressions on one line--one from Julia's feedback.
Signed-off-by Maya Nakamura <[email protected]>--- drivers/staging/rtlwifi/phydm/phydm_debug.c | 4 +--- drivers/staging/rtlwifi/phydm/phydm_hwconfig.c | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-)drivers/staging/rtlwifi/phydm/phydm_debug.c +1
-3@@ -159,9 +159,7 @@ void phydm_init_debug_setting(struct phy_dm_struct *dm) dm->debug_level =ODM_DBG_TRACE ; dm->fw_debug_components =0 ; - dm->debug_components = - -0 ; + dm->debug_components =0 ; dm->fw_buff_is_enpty = true; dm->pre_c2h_seq =0 ;drivers/staging/rtlwifi/phydm/phydm_hwconfig.c +0
-0drivers/staging/rtlwifi/phydm/phydm_hwconfig.c static u32 phydm_process_rssi_pwdb(struct phy_dm_struct *dm, · line 49
Quoted 7 lines
drivers/staging/rtlwifi/phydm/phydm_hwconfig.c +2
-2@@ -45,8 +45,8 @@ static u32 phydm_process_rssi_pwdb(struct phy_dm_struct *dm,u32 weighting =0 , undecorated_smoothed_pwdb;/* 2011.07.28 LukeLee: modified to prevent unstable CCK RSSI */ -if (entry->rssi_stat.ofdm_pkt == -64 ) {/* speed up when all packets are OFDM*/ +if (entry->rssi_stat.ofdm_pkt ==64 ) { +/* speed up when all packets are OFDM*/ There is another small cleanup you could do here, to put a space in front of the */
Quoted 1 line
julia
Thank you for pointing that out! I will add a space and resubmit this patchset.
Maya
Quoted 13 lines
Quoted 13 lines
drivers/staging/rtlwifi/phydm/phydm_hwconfig.c +0
-1undecorated_smoothed_pwdb = undecorated_smoothed_ofdm; ODM_RT_TRACE(dm, ODM_COMP_RSSI_MONITOR, "PWDB_0[%d] = (( %d ))\n", pktinfo->station_id, --2.17.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/368f5b749807cd02336274f978f3c6451655583d.1540968891.git.m.maya.nakamura%40gmail.com.
For more options, visit https://groups.google.com/d/optout.