Skip to contentSkip to conversation

Staging: rtl8192u: ieee80211_rx: Remove unused code

PATCH In review Shivani Bhardwaj 2 participants 7 messages Oct 14, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: rtl8192u: ieee80211_rx: Remove unused code

The variable frame_authorized is declared and mentioned in the code but is not used anywhere so, it should be removed.
Semantic patch used:
@@
type T;
identifier i;
constant C;
position p != e.p;
@@

- T i@p;
<+... when != i
- i = C;
...+>

---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -3
index 4b5f32d..ab60c3f 100644
@@ -899,7 +899,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 	struct net_device *wds = NULL;
 	struct sk_buff *skb2 = NULL;
 	struct net_device *wds = NULL;
-	int frame_authorized = 0;
 	int from_assoc_ap = 0;
 	void *sta = NULL;
 #endif
@@ -1106,10 +1105,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 		switch (hostap_handle_sta_rx(ieee, dev, skb, rx_stats,
 					     wds != NULL)) {
 		case AP_RX_CONTINUE_NOT_AUTHORIZED:
-			frame_authorized = 0;
 			break;
 		case AP_RX_CONTINUE:
-			frame_authorized = 1;
 			break;
 		case AP_RX_DROP:
 			goto rx_dropped;
Signature · 1 line
2.1.0
#1 lore raw
Quoted 33 lines · Shivani Bhardwaj

The variable frame_authorized is declared and mentioned in the code but is not used anywhere so, it should be removed.
Semantic patch used:
@@
type T;
identifier i;
constant C;
position p != e.p;
@@

- T i@p;
<+... when != i
- i = C;
...+>

---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -1
index 4b5f32d..ab60c3f 100644
@@ -899,7 +899,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 	struct net_device *wds = NULL;
 	struct sk_buff *skb2 = NULL;
 	struct net_device *wds = NULL;
-	int frame_authorized = 0;
 	int from_assoc_ap = 0;
 	void *sta = NULL;
 #endif

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, · line 1110

Quoted 8 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -2
@@ -1106,10 +1105,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 		switch (hostap_handle_sta_rx(ieee, dev, skb, rx_stats,
 					     wds != NULL)) {
 		case AP_RX_CONTINUE_NOT_AUTHORIZED:
-			frame_authorized = 0;
 			break;
 		case AP_RX_CONTINUE:
-			frame_authorized = 1;
 			break;

Should the cases be merged? I don't know what is the common strategy in the Linux kernel.

julia

Quoted 12 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -1
 		case AP_RX_DROP:
 			goto rx_dropped;
--

2.1.0

--
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/20151014142414.GA17736%40ubuntu.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 49 lines · Julia Lawall
Quoted 33 lines · Shivani Bhardwaj

The variable frame_authorized is declared and mentioned in the code but is not used anywhere so, it should be removed.
Semantic patch used:
@@
type T;
identifier i;
constant C;
position p != e.p;
@@

- T i@p;
<+... when != i
- i = C;
...+>

---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -1
index 4b5f32d..ab60c3f 100644
@@ -899,7 +899,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
      struct net_device *wds = NULL;
      struct sk_buff *skb2 = NULL;
      struct net_device *wds = NULL;
-     int frame_authorized = 0;
      int from_assoc_ap = 0;
      void *sta = NULL;
 #endif

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, · line 1110

Quoted 8 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -2
@@ -1106,10 +1105,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
              switch (hostap_handle_sta_rx(ieee, dev, skb, rx_stats,
                                           wds != NULL)) {
              case AP_RX_CONTINUE_NOT_AUTHORIZED:
-                     frame_authorized = 0;
                      break;
              case AP_RX_CONTINUE:
-                     frame_authorized = 1;
                      break;

Should the cases be merged? I don't know what is the common strategy in the Linux kernel.

Quoted 2 lines

julia

What do you suggest?

Quoted 12 lines
Quoted 12 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -1
              case AP_RX_DROP:
                      goto rx_dropped;
--

2.1.0

--
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/20151014142414.GA17736%40ubuntu.
For more options, visit https://groups.google.com/d/optout.

#3 lore raw
Quoted 50 lines · Shivani Bhardwaj
Quoted 49 lines · Julia Lawall
Quoted 33 lines · Shivani Bhardwaj

The variable frame_authorized is declared and mentioned in the code but is not used anywhere so, it should be removed.
Semantic patch used:
@@
type T;
identifier i;
constant C;
position p != e.p;
@@

- T i@p;
<+... when != i
- i = C;
...+>

---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -1
index 4b5f32d..ab60c3f 100644
@@ -899,7 +899,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
      struct net_device *wds = NULL;
      struct sk_buff *skb2 = NULL;
      struct net_device *wds = NULL;
-     int frame_authorized = 0;
      int from_assoc_ap = 0;
      void *sta = NULL;
 #endif

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, · line 1110

Quoted 8 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -2
@@ -1106,10 +1105,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
              switch (hostap_handle_sta_rx(ieee, dev, skb, rx_stats,
                                           wds != NULL)) {
              case AP_RX_CONTINUE_NOT_AUTHORIZED:
-                     frame_authorized = 0;
                      break;
              case AP_RX_CONTINUE:
-                     frame_authorized = 1;
                      break;

Should the cases be merged? I don't know what is the common strategy in the Linux kernel.

Quoted 4 lines
Quoted 2 lines

julia

What do you suggest?

case AP_RX_CONTINUE_NOT_AUTHORIZED:
case AP_RX_CONTINUE:

         break;

Normally, falling through from one case to the next is a possible source of errors, but when there is nothing to do, perhaps the code becomes more concise and clear.

julia

Quoted 21 lines
Quoted 6 lines
Quoted 6 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -1
              case AP_RX_DROP:
                      goto rx_dropped;
--

2.1.0

Quoted 7 lines
Quoted 7 lines

--
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/20151014142414.GA17736%40ubuntu.
For more options, visit https://groups.google.com/d/optout.

--
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/CAKHNQQHjzrqSggo57khaaV%2BBsv28NKUawQcbbhEmnXVy_80OZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

#4 lore raw
Quoted 61 lines · Julia Lawall
Quoted 50 lines · Shivani Bhardwaj
Quoted 49 lines · Julia Lawall
Quoted 33 lines · Shivani Bhardwaj

The variable frame_authorized is declared and mentioned in the code but is not used anywhere so, it should be removed.
Semantic patch used:
@@
type T;
identifier i;
constant C;
position p != e.p;
@@

- T i@p;
<+... when != i
- i = C;
...+>

---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -1
index 4b5f32d..ab60c3f 100644
@@ -899,7 +899,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
      struct net_device *wds = NULL;
      struct sk_buff *skb2 = NULL;
      struct net_device *wds = NULL;
-     int frame_authorized = 0;
      int from_assoc_ap = 0;
      void *sta = NULL;
 #endif

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, · line 1110

Quoted 8 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -2
@@ -1106,10 +1105,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
              switch (hostap_handle_sta_rx(ieee, dev, skb, rx_stats,
                                           wds != NULL)) {
              case AP_RX_CONTINUE_NOT_AUTHORIZED:
-                     frame_authorized = 0;
                      break;
              case AP_RX_CONTINUE:
-                     frame_authorized = 1;
                      break;

Should the cases be merged? I don't know what is the common strategy in the Linux kernel.

Quoted 4 lines
Quoted 2 lines

julia

What do you suggest?

case AP_RX_CONTINUE_NOT_AUTHORIZED:
case AP_RX_CONTINUE:

Quoted 8 lines
         break;

Normally, falling through from one case to the next is a possible source of errors, but when there is nothing to do, perhaps the code becomes more concise and clear.

julia

Fine. I'll do this.
Thank you. :)

Quoted 21 lines
Quoted 21 lines
Quoted 6 lines
Quoted 6 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -1
              case AP_RX_DROP:
                      goto rx_dropped;
--

2.1.0

Quoted 7 lines
Quoted 7 lines

--
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/20151014142414.GA17736%40ubuntu.
For more options, visit https://groups.google.com/d/optout.

--
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/CAKHNQQHjzrqSggo57khaaV%2BBsv28NKUawQcbbhEmnXVy_80OZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

#5 lore raw
Quoted 64 lines · Shivani Bhardwaj
Quoted 63 lines · Julia Lawall
Quoted 50 lines · Shivani Bhardwaj
Quoted 49 lines · Julia Lawall
Quoted 33 lines · Shivani Bhardwaj

The variable frame_authorized is declared and mentioned in the code but is not used anywhere so, it should be removed.
Semantic patch used:
@@
type T;
identifier i;
constant C;
position p != e.p;
@@

- T i@p;
<+... when != i
- i = C;
...+>

---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -1
index 4b5f32d..ab60c3f 100644
@@ -899,7 +899,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
      struct net_device *wds = NULL;
      struct sk_buff *skb2 = NULL;
      struct net_device *wds = NULL;
-     int frame_authorized = 0;
      int from_assoc_ap = 0;
      void *sta = NULL;
 #endif

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, · line 1110

Quoted 8 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -2
@@ -1106,10 +1105,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
              switch (hostap_handle_sta_rx(ieee, dev, skb, rx_stats,
                                           wds != NULL)) {
              case AP_RX_CONTINUE_NOT_AUTHORIZED:
-                     frame_authorized = 0;
                      break;
              case AP_RX_CONTINUE:
-                     frame_authorized = 1;
                      break;

Should the cases be merged? I don't know what is the common strategy in the Linux kernel.

Quoted 4 lines
Quoted 2 lines

julia

What do you suggest?

case AP_RX_CONTINUE_NOT_AUTHORIZED:
case AP_RX_CONTINUE:

         break;
Quoted 6 lines
Quoted 6 lines

Normally, falling through from one case to the next is a possible source of errors, but when there is nothing to do, perhaps the code becomes more concise and clear.

julia

Should I send this as a patch series? Or combining the cases will look fine under the heading "removing extra code" with the other code?

Quoted 25 lines

Fine. I'll do this.
Thank you. :)

Quoted 21 lines
Quoted 21 lines
Quoted 6 lines
Quoted 6 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -1
              case AP_RX_DROP:
                      goto rx_dropped;
--

2.1.0

Quoted 7 lines
Quoted 7 lines

--
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/20151014142414.GA17736%40ubuntu.
For more options, visit https://groups.google.com/d/optout.

--
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/CAKHNQQHjzrqSggo57khaaV%2BBsv28NKUawQcbbhEmnXVy_80OZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

#6 lore raw
Quoted 69 lines · Shivani Bhardwaj
Quoted 68 lines · Shivani Bhardwaj
Quoted 67 lines · Julia Lawall
Quoted 50 lines · Shivani Bhardwaj
Quoted 49 lines · Julia Lawall
Quoted 33 lines · Shivani Bhardwaj

The variable frame_authorized is declared and mentioned in the code but is not used anywhere so, it should be removed.
Semantic patch used:
@@
type T;
identifier i;
constant C;
position p != e.p;
@@

- T i@p;
<+... when != i
- i = C;
...+>

---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -1
index 4b5f32d..ab60c3f 100644
@@ -899,7 +899,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
      struct net_device *wds = NULL;
      struct sk_buff *skb2 = NULL;
      struct net_device *wds = NULL;
-     int frame_authorized = 0;
      int from_assoc_ap = 0;
      void *sta = NULL;
 #endif

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, · line 1110

Quoted 8 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -2
@@ -1106,10 +1105,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
              switch (hostap_handle_sta_rx(ieee, dev, skb, rx_stats,
                                           wds != NULL)) {
              case AP_RX_CONTINUE_NOT_AUTHORIZED:
-                     frame_authorized = 0;
                      break;
              case AP_RX_CONTINUE:
-                     frame_authorized = 1;
                      break;

Should the cases be merged? I don't know what is the common strategy in the Linux kernel.

Quoted 4 lines
Quoted 2 lines

julia

What do you suggest?

case AP_RX_CONTINUE_NOT_AUTHORIZED:
case AP_RX_CONTINUE:

         break;

Normally, falling through from one case to the next is a possible source of errors, but when there is nothing to do, perhaps the code becomes more concise and clear.

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines

julia

Should I send this as a patch series? Or combining the cases will look fine under the heading "removing extra code" with the other code?

I think it could be done at once.

julia

Quoted 34 lines
Quoted 26 lines

Fine. I'll do this.
Thank you. :)

Quoted 21 lines
Quoted 21 lines
Quoted 6 lines
Quoted 6 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +0 -1
              case AP_RX_DROP:
                      goto rx_dropped;
--

2.1.0

Quoted 7 lines
Quoted 7 lines

--
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/20151014142414.GA17736%40ubuntu.
For more options, visit https://groups.google.com/d/optout.

--
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/CAKHNQQHjzrqSggo57khaaV%2BBsv28NKUawQcbbhEmnXVy_80OZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CAKHNQQEQYMt3pHCOK9%3DwP_29hk1PD2%3Dh5PkJx4%3D9WcYeGUB2iA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.