Skip to contentSkip to conversation

staging: rtlwifi: phydm: Remove parentheses

PATCH Superseded Nishka Dasgupta 2 participants 2 messages Mar 30, 2019 Staging

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: rtlwifi: phydm: Remove parentheses

Remove unnecessary parentheses on the right hand side and simplify expression. Issue first detected using Coccinelle.

---
Changes in v2:
- Change status = status & <expression> to status &= <expression>, to make the code more readable.

 drivers/staging/rtlwifi/phydm/phydm_debug.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
drivers/staging/rtlwifi/phydm/phydm_debug.c +8 -10
index 91f2c054d83b..13b34dc33011 100644
@@ -51,20 +51,18 @@ 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,
-						  (enum odm_rf_radio_path)
+				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(
-						  dm, power_index,
-						  (enum odm_rf_radio_path)
+				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
#1 lore raw
Quoted 1 line · Nishka Dasgupta' via outreachy-kernel

Remove unnecessary parentheses on the right hand side and simplify expression.

The simplification should be explained in the commit log. The log message should be under 80 characters wide.

julia

Quoted 54 lines

Issue first detected using Coccinelle.

---
Changes in v2:
- Change status = status & <expression> to status &= <expression>, to make the code more readable.

 drivers/staging/rtlwifi/phydm/phydm_debug.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
drivers/staging/rtlwifi/phydm/phydm_debug.c +8 -11
index 91f2c054d83b..13b34dc33011 100644
@@ -51,20 +51,18 @@ 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,
-						  (enum odm_rf_radio_path)
+				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(
-						  dm, power_index,
-						  (enum odm_rf_radio_path)
+				status &= phydm_api_set_txagc(
+						   dm, power_index,
+						   (enum odm_rf_radio_path)
 							  dm_value[1],
-						  i, false));
+						   i, false);
 		}
 
 		if (status)
--

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/20190330151341.3891-1-nishka.dasgupta%40yahoo.com.
For more options, visit https://groups.google.com/d/optout.