Skip to contentSkip to conversation

staging: rtl8192e: Remove multiple assignments

PATCH In review Bhaktipriya Shridhar 2 participants 2 messages Mar 5, 2016 – Mar 11, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8192e: Remove multiple assignments

This patch removes multiple assignments by factorizing them.

This was done with Coccinelle.

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

---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +4 -2
index b6b714d..6834652 100644
@@ -887,8 +887,10 @@ 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;
+		if (tmpval >= 6) {
+			tmpOFDMindex = 0;
+			tmpCCK20Mindex = 0;
+		}
 		else
 			tmpOFDMindex = tmpCCK20Mindex = 6 - tmpval;
 		tmpCCK40Mindex = 0;

--
2.1.4

maintainer
#1 lore raw
Quoted 19 lines · Bhaktipriya Shridhar

This patch removes multiple assignments by factorizing them.

This was done with Coccinelle.

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

---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +0 -0
index b6b714d..6834652 100644

drivers/staging/rtl8192e/rtl8192e/rtl_dm.c static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev) · line 894

Quoted 10 lines
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +4 -2
@@ -887,8 +887,10 @@ 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;
+		if (tmpval >= 6) {
+			tmpOFDMindex = 0;
+			tmpCCK20Mindex = 0;
+		}
 		else

Your brace placement is wrong here :(