staging: rtlwifi: Modify bool operations and clean up spacing
cover staging: rtlwifi: Modify bool operations and clean up spacing
This patchset modifies bool assignments of 1 and a comparison with 1. It adds blank lines after if's and spaces before and after comments. It also changes line endings.
Maya Nakamura (2):
staging: rtlwifi: Replace 1 with true and remove comparison for bool
staging: rtlwifi: Change line and comment spacing
drivers/staging/rtlwifi/phydm/phydm_adc_sampling.c | 12 ++++++------ drivers/staging/rtlwifi/phydm/phydm_ccx.c | 12 +++++++----- 2 files changed, 13 insertions(+), 11 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/2 staging: rtlwifi: Replace 1 with true and remove comparison for bool
Replace 1 with true for bool assignments and remove a comparison of a bool with 1. Issues found by Coccinelle's semantic patch results for boolinit.cocci.
--- drivers/staging/rtlwifi/phydm/phydm_adc_sampling.c | 2 +- drivers/staging/rtlwifi/phydm/phydm_ccx.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtlwifi/phydm/phydm_adc_sampling.c +1 -1
@@ -555,7 +555,7 @@ void phydm_lamode_trigger_setting(void *dm_void, char input[][16], u32 *_used, output + used, out_len - used, "{En} {0:BB,1:BB_MAC,2:RF0,3:RF1,4:MAC}\n {BB:dbg_port[bit],BB_MAC:0-ok/1-fail/2-cca,MAC:ref} {DMA type} {TrigTime}\n {polling_time/ref_mask} {dbg_port} {0:P_Edge, 1:N_Edge} {SpRate:0-80M,1-40M,2-20M} {Capture num}\n");/**/ - }else if (is_enable_la_mode ==1 ) { + }else if (is_enable_la_mode) {PHYDM_SSCANF (input[2 ],DCMD_DECIMAL , &var1[1 ]); trig_mode = (u8 )var1[1 ];
drivers/staging/rtlwifi/phydm/phydm_ccx.c +2 -2
@@ -338,7 +338,7 @@ bool phydm_check_nhm_ready(void *dm_void)ODM_delay_ms (1 );if (odm_get_bb_reg (dm,ODM_REG_NHM_DUR_READY_11AC ,BIT (17 ))) { - ret =1 ; + ret = true;break ; } }
@@ -351,7 +351,7 @@ bool phydm_check_nhm_ready(void *dm_void)ODM_delay_ms (1 );if (odm_get_bb_reg (dm,ODM_REG_NHM_DUR_READY_11AC ,BIT (17 ))) { - ret =1 ; + ret = true;break ; } }
Signature · 1 line
2.17.1
PATCH 2/2 staging: rtlwifi: Change line and comment spacing
In reply to Maya NakamuraAdd blank lines at the end of if statements and spaces before and after comments. Edit statements so that the line does not end with an assignment operator or a parenthesis. Remove a blank comment, too.
--- drivers/staging/rtlwifi/phydm/phydm_adc_sampling.c | 10 +++++----- drivers/staging/rtlwifi/phydm/phydm_ccx.c | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-)
drivers/staging/rtlwifi/phydm/phydm_adc_sampling.c +5 -5
@@ -551,10 +551,9 @@ void phydm_lamode_trigger_setting(void *dm_void, char input[][16], u32 *_used,/*dbg_print("echo cmd input_num = %d\n", input_num);*/ if ((strcmp (input[1 ], help) ==0 )) { -PHYDM_SNPRINTF ( - output + used, out_len - used, -"{En} {0:BB,1:BB_MAC,2:RF0,3:RF1,4:MAC}\n {BB:dbg_port[bit],BB_MAC:0-ok/1-fail/2-cca,MAC:ref} {DMA type} {TrigTime}\n {polling_time/ref_mask} {dbg_port} {0:P_Edge, 1:N_Edge} {SpRate:0-80M,1-40M,2-20M} {Capture num}\n" ); -/**/ +PHYDM_SNPRINTF (output + used, + out_len - used, +"{En} {0:BB,1:BB_MAC,2:RF0,3:RF1,4:MAC}\n {BB:dbg_port[bit],BB_MAC:0-ok/1-fail/2-cca,MAC:ref} {DMA type} {TrigTime}\n {polling_time/ref_mask} {dbg_port} {0:P_Edge, 1:N_Edge} {SpRate:0-80M,1-40M,2-20M} {Capture num}\n" ); }else if (is_enable_la_mode) {PHYDM_SSCANF (input[2 ],DCMD_DECIMAL , &var1[1 ]);
@@ -564,6 +563,7 @@ void phydm_lamode_trigger_setting(void *dm_void, char input[][16], u32 *_used,PHYDM_SSCANF (input[3 ],DCMD_HEX , &var1[2 ]); else PHYDM_SSCANF(input[3], DCMD_DECIMAL, &var1[2]); + trig_sig_sel = var1[2 ];PHYDM_SSCANF (input[4 ],DCMD_DECIMAL , &var1[3 ]);
@@ -575,7 +575,7 @@ void phydm_lamode_trigger_setting(void *dm_void, char input[][16], u32 *_used,PHYDM_SSCANF (input[10 ],DCMD_DECIMAL , &var1[9 ]); dma_data_sig_sel = (u8 )var1[3 ]; - trigger_time_mu_sec = var1[4 ];/*unit: us*/ + trigger_time_mu_sec = var1[4 ];/* unit: us */ adc_smp->la_mac_ref_mask = var1[5 ]; adc_smp->la_dbg_port = var1[6 ];
drivers/staging/rtlwifi/phydm/phydm_ccx.c +5 -3
@@ -317,7 +317,7 @@ void phydm_get_nhm_result(void *dm_void) ccx_info->NHM_result[10 ] = (u8)((value32 &MASKBYTE2 ) >>16 ); ccx_info->NHM_result[11 ] = (u8)((value32 &MASKBYTE3 ) >>24 ); -/*Get NHM duration*/ +/* Get NHM duration */ value32 =odm_read_4byte (dm,ODM_REG_NHM_CNT10_TO_CNT11_11N ); ccx_info->NHM_duration = (u16)(value32 &MASKLWORD ); }
@@ -331,8 +331,9 @@ bool phydm_check_nhm_ready(void *dm_void)bool ret = false;if (dm->support_ic_type &ODM_IC_11AC_SERIES ) { - value32 = -odm_get_bb_reg (dm,ODM_REG_CLM_RESULT_11AC ,MASKDWORD ); + value32 =odm_get_bb_reg (dm, +ODM_REG_CLM_RESULT_11AC , +MASKDWORD );for (i =0 ; i <200 ; i++) {ODM_delay_ms (1 );
@@ -356,6 +357,7 @@ bool phydm_check_nhm_ready(void *dm_void) } } } +return ret; }
Signature · 1 line
2.17.1
Greg KH
maintainerRe: [PATCH 2/2] staging: rtlwifi: Change line and comment spacing
Quoted 3 lines · Maya Nakamura
Add blank lines at the end of if statements and spaces before and after comments. Edit statements so that the line does not end with an assignment operator or a parenthesis. Remove a blank comment, too.
That is a lot of different things all in one patch. Please only do one "logical" type of thing. This should be broken up into multiple patches please.
thanks,
greg k-h
Re: [PATCH 2/2] staging: rtlwifi: Change line and comment spacing
Quoted 5 lines · Greg KH
Quoted 3 lines · Maya Nakamura
Add blank lines at the end of if statements and spaces before and after comments. Edit statements so that the line does not end with an assignment operator or a parenthesis. Remove a blank comment, too.
Quoted 7 lines
That is a lot of different things all in one patch. Please only do one "logical" type of thing. This should be broken up into multiple patches please.
thanks,
greg k-h
Hi Greg,
Sorry for taking time to resubmit my correction! It is a new patchset because you accepted a part of the previous patchset ([PATCH 0/2] staging:
rtlwifi: Modify bool operations and clean up spacing) on the 5th.
Thank you!
Maya