Simplify expressions in phydm_debug.c
v5 cover Simplify expressions in phydm_debug.c
This patchset removes parentheses from the right-hand side of expressions in phydm_debug.c and also moves an operator to the right hand side to make the code more readable.
Nishka Dasgupta (2):
staging: rtlwifi: phydm: Remove parentheses
staging: rtlwifi: phydm: Simplify status = status & <expression>
drivers/staging/rtlwifi/phydm/phydm_debug.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
Signature · 3 lines
Changes in v5: - Make the two patches a patchset. 2.19.1
PATCH v5 1/2 staging: rtlwifi: phydm: Remove parentheses
Remove parentheses on right hand side of expression. Issue found with Coccinelle.
--- drivers/staging/rtlwifi/phydm/phydm_debug.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtlwifi/phydm/phydm_debug.c +5 -5
@@ -51,20 +51,20 @@ static inline void phydm_check_dmval_txagc(struct phy_dm_struct *dm, u32 used, (power_index <<16 ) | (power_index <<8 ) | (power_index);for (i =0 ; i <ODM_RATEVHTSS2MCS9 ; i +=4 ) - status = (status & + status = status &phydm_api_set_txagc ( dm, power_index, (enum odm_rf_radio_path ) dm_value[1 ], - i, false)); + i, false); }else if (dm->support_ic_type &ODM_RTL8197F ) {for (i =0 ; i <=ODM_RATEMCS15 ; i++) - status = (status & -phydm_api_set_txagc ( + status = status & +phydm_api_set_txagc ( dm, power_index, (enum odm_rf_radio_path ) dm_value[1 ], - i, false)); + i, false); }if (status)
Signature · 1 line
2.19.1
PATCH v5 2/2 staging: rtlwifi: phydm: Simplify `status = status & <expression>`
In reply to Nishka DasguptaSimplify occurrences of status = status & <expression> by modifying them to `status &= <expression> to make the code more readable.
--- drivers/staging/rtlwifi/phydm/phydm_debug.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/staging/rtlwifi/phydm/phydm_debug.c +2 -6
@@ -51,17 +51,13 @@ static inline void phydm_check_dmval_txagc(struct phy_dm_struct *dm, u32 used, (power_index <<16 ) | (power_index <<8 ) | (power_index);for (i =0 ; i <ODM_RATEVHTSS2MCS9 ; i +=4 ) - status = status & -phydm_api_set_txagc ( - dm, power_index, + status &=phydm_api_set_txagc (dm, power_index, (enum odm_rf_radio_path ) dm_value[1 ], i, false); }else if (dm->support_ic_type &ODM_RTL8197F ) {for (i =0 ; i <=ODM_RATEMCS15 ; i++) - status = status & -phydm_api_set_txagc ( - dm, power_index, + status &=phydm_api_set_txagc (dm, power_index, (enum odm_rf_radio_path ) dm_value[1 ], i, false);
Signature · 1 line
2.19.1
Re: [Outreachy kernel] [PATCH 2/2 v5] staging: rtlwifi: phydm: Simplify `status = status & <expression>`
Quoted 2 lines · Nishka Dasgupta' via outreachy-kernel
Simplify occurrences of
status = status & <expression>by modifying them to `status &= <expression> to make the code more readable.
There needs to be three patches. The arguments should be moved up in a separate one. The log message of this one doens't mention that.
julia
Quoted 40 lines
Signed-off-by Nishka Dasgupta <[email protected]>--- drivers/staging/rtlwifi/phydm/phydm_debug.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)drivers/staging/rtlwifi/phydm/phydm_debug.c +2
-7@@ -51,17 +51,13 @@ static inline void phydm_check_dmval_txagc(struct phy_dm_struct *dm, u32 used, (power_index <<16 ) | (power_index <<8 ) | (power_index);for (i =0 ; i <ODM_RATEVHTSS2MCS9 ; i +=4 ) - status = status & -phydm_api_set_txagc ( - dm, power_index, + status &=phydm_api_set_txagc (dm, power_index, (enum odm_rf_radio_path ) dm_value[1 ], i, false); }else if (dm->support_ic_type &ODM_RTL8197F ) {for (i =0 ; i <=ODM_RATEMCS15 ; i++) - status = status & -phydm_api_set_txagc ( - dm, power_index, + status &=phydm_api_set_txagc (dm, power_index, (enum odm_rf_radio_path ) dm_value[1 ], i, false); --2.19.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/423db52767ef4efafe5a078aecb1691d4bab9138.1553964092.git.nishka.dasgupta%40yahoo.com.
For more options, visit https://groups.google.com/d/optout.