mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: rtlwifi: delete double assignment
@ 2017-09-15 12:34 Harsha Sharma
  2017-09-15 13:42 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 2+ messages in thread
From: Harsha Sharma @ 2017-09-15 12:34 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, outreachy-kernel, 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;
)

Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
---
 drivers/staging/rtlwifi/base.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtlwifi/base.c b/drivers/staging/rtlwifi/base.c
index b88b0e8..68bd124 100644
--- a/drivers/staging/rtlwifi/base.c
+++ b/drivers/staging/rtlwifi/base.c
@@ -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");
-- 
1.9.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Outreachy kernel] [PATCH] staging: rtlwifi: delete double assignment
  2017-09-15 12:34 [PATCH] staging: rtlwifi: delete double assignment Harsha Sharma
@ 2017-09-15 13:42 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2017-09-15 13:42 UTC (permalink / raw)
  To: Harsha Sharma; +Cc: gregkh, devel, linux-kernel, outreachy-kernel



On Fri, 15 Sep 2017, Harsha Sharma wrote:

> 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;
> )
>
> Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
> ---
>  drivers/staging/rtlwifi/base.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/staging/rtlwifi/base.c b/drivers/staging/rtlwifi/base.c
> index b88b0e8..68bd124 100644
> --- a/drivers/staging/rtlwifi/base.c
> +++ b/drivers/staging/rtlwifi/base.c
> @@ -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

>
>  		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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-15 13:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-15 12:34 [PATCH] staging: rtlwifi: delete double assignment Harsha Sharma
2017-09-15 13:42 ` [Outreachy kernel] " Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®