Skip to contentSkip to conversation

staging: rtlwifi: delete double assignment

PATCH In review Harsha Sharma 2 participants 2 messages Sep 15, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtlwifi: delete double assignment

Remove two adjacent assignments to the same location. In practice, many such occurences are intentional but this case don't seem to fall into that category. Done using following coccinelle semantic patch

@@
expression e1,e2,e3;
@@

(
(<+...e1++...+>)=e2;
|
(<+...e1--...+>)=e2;
|
(<+...++e1...+>)=e2;
|
(<+...--e1...+>)=e2;
|
e1=e2;
e1 = <+...e1...+>;
|
*e1=e2;
*e1=e3;
)

---
 drivers/staging/rtlwifi/base.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/rtlwifi/base.c +0 -1
index b88b0e8..68bd124 100644
@@ -1536,7 +1536,6 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx,
 		/* EAPOL is seen as in-4way */
 		rtlpriv->btcoexist.btc_info.in_4way = true;
 		rtlpriv->btcoexist.btc_info.in_4way_ts = jiffies;
-		rtlpriv->btcoexist.btc_info.in_4way_ts = jiffies;
 
 		RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG,
 			 "802.1X %s EAPOL pkt!!\n", (is_tx) ? "Tx" : "Rx");
Signature · 1 line
1.9.1
#1 lore raw
Quoted 35 lines · Harsha Sharma

Remove two adjacent assignments to the same location. In practice, many such occurences are intentional but this case don't seem to fall into that category. Done using following coccinelle semantic patch

@@
expression e1,e2,e3;
@@

(
(<+...e1++...+>)=e2;
|
(<+...e1--...+>)=e2;
|
(<+...++e1...+>)=e2;
|
(<+...--e1...+>)=e2;
|
e1=e2;
e1 = <+...e1...+>;
|
*e1=e2;
*e1=e3;
)

---
 drivers/staging/rtlwifi/base.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/rtlwifi/base.c +0 -0
index b88b0e8..68bd124 100644

drivers/staging/rtlwifi/base.c u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx, · line 1539

Quoted 4 lines
drivers/staging/rtlwifi/base.c +0 -1
@@ -1536,7 +1536,6 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx,
 		/* EAPOL is seen as in-4way */
 		rtlpriv->btcoexist.btc_info.in_4way = true;
 		rtlpriv->btcoexist.btc_info.in_4way_ts = jiffies;
-		rtlpriv->btcoexist.btc_info.in_4way_ts = jiffies;

For something like this, it can be useful to do a git blame on the lines. If they were both introduced at the same time, it probably doesn't tell you anything. But if there was one and then someone explicitly introduced another one, then there could have been some reason for doing that.

julia

Quoted 13 lines
drivers/staging/rtlwifi/base.c +0 -1
 		RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG,
 			 "802.1X %s EAPOL pkt!!\n", (is_tx) ? "Tx" : "Rx");
--

1.9.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/1505478887-1820-1-git-send-email-harshasharmaiitr%40gmail.com.
For more options, visit https://groups.google.com/d/optout.