Skip to contentSkip to conversation

staging: rtl8192e: Remove multiple assignments

PATCH Superseded Gargi Sharma 1 participant 1 message Mar 11, 2017 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: rtl8192e: Remove multiple assignments

This patch removes multiple assignments by factorizing them. This was done with Coccinelle for the if branch. For the else part the change was done manually. Braces were also added to the else part to remove the checkpatch warning, "braces should be on all arms of if-else statements".

@ identifier i1,i2; constant c; @@
- i1=i2=c;
+ i1=c;
+ i2=c;

---
Changes in v2:
- Remove multiple assignments on the else branch as well. Done manually.

---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +7 -4
index d101974..d40621c 100644
@@ -887,10 +887,13 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
 			tmpCCK40Mindex = CCK_Table_length-1;
 	} else {
 		tmpval = (u8)tmpRegA - priv->ThermalMeter[0];
-		if (tmpval >= 6)
-			tmpOFDMindex = tmpCCK20Mindex = 0;
-		else
-			tmpOFDMindex = tmpCCK20Mindex = 6 - tmpval;
+		if (tmpval >= 6) {
+			tmpOFDMindex = 0;
+			tmpCCK20Mindex = 0;
+		} else {
+			tmpOFDMindex = 6 - tmpval;
+			tmpCCK20Mindex = 6 - tmpval;
+		}
 		tmpCCK40Mindex = 0;
 	}
 	if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20)
Signature · 1 line
2.7.4