Skip to contentSkip to conversation

staging: rtlwifi: remove condition where it has no effect

PATCH Superseded Santha Meena Ramamoorthy 2 participants 5 messages Mar 2, 2018 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtlwifi: remove condition where it has no effect

Remove condition where if and else branch are functionally identical. Issue found using cond_no_effect.cocci Coccinelle script.

---
 drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c +2 -6
index ffff5b0..5b82640 100644
@@ -2885,12 +2885,8 @@ static void halbtc8822b2ant_action_a2dp(struct btc_coexist *btcoexist)
 							     NORMAL_EXEC, 5);
 
 		} else {
-			if (wifi_turbo)
-				halbtc8822b2ant_coex_table_with_type(
-					btcoexist, NORMAL_EXEC, 10);
-			else
-				halbtc8822b2ant_coex_table_with_type(
-					btcoexist, NORMAL_EXEC, 10);
+			halbtc8822b2ant_coex_table_with_type(btcoexist,
+							     NORMAL_EXEC, 10);
 
 			halbtc8822b2ant_ps_tdma(btcoexist, NORMAL_EXEC, true,
 						109);
Signature · 1 line
2.7.4
#1 lore raw
Quoted 2 lines · Santha Meena Ramamoorthy

Remove condition where if and else branch are functionally identical. Issue found using cond_no_effect.cocci Coccinelle script.

Actually, there are just identical, period. It would be good to remove "functionally".

Since having such code that is completely duplicated is a little bit strange, it could be good to enlarge the recipient list to:

Ping-Ke Shih <[email protected]> (commit_signer:1/1=100%,authored:1/1=100%,added_lines:5225/5225=100%) Larry Finger <[email protected]> (commit_signer:1/1=100%) [email protected] (open list:STAGING SUBSYSTEM)

Maybe someone out there would know if actually some different arguments were intended.

julia

Quoted 35 lines
---
 drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c +2 -7
index ffff5b0..5b82640 100644
@@ -2885,12 +2885,8 @@ static void halbtc8822b2ant_action_a2dp(struct btc_coexist *btcoexist)
 							     NORMAL_EXEC, 5);
 
 		} else {
-			if (wifi_turbo)
-				halbtc8822b2ant_coex_table_with_type(
-					btcoexist, NORMAL_EXEC, 10);
-			else
-				halbtc8822b2ant_coex_table_with_type(
-					btcoexist, NORMAL_EXEC, 10);
+			halbtc8822b2ant_coex_table_with_type(btcoexist,
+							     NORMAL_EXEC, 10);
 
 			halbtc8822b2ant_ps_tdma(btcoexist, NORMAL_EXEC, true,
 						109);
--

2.7.4

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

#2 lore raw
Quoted 18 lines · Julia Lawall
Quoted 2 lines · Santha Meena Ramamoorthy

Remove condition where if and else branch are functionally identical. Issue found using cond_no_effect.cocci Coccinelle script.

Actually, there are just identical, period. It would be good to remove "functionally".

Since having such code that is completely duplicated is a little bit strange, it could be good to enlarge the recipient list to:

Ping-Ke Shih <[email protected]> (commit_signer:1/1=100%,authored:1/1=100%,added_lines:5225/5225=100%) Larry Finger <[email protected]> (commit_signer:1/1=100%) [email protected] (open list:STAGING SUBSYSTEM)

Quoted 5 lines

Maybe someone out there would know if actually some different arguments were intended.

julia

Hi,

Sure, I will do it now. I guess that should be v2 of the patch.

Quoted 35 lines
Quoted 35 lines
---
 drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c +2 -7
index ffff5b0..5b82640 100644
@@ -2885,12 +2885,8 @@ static void halbtc8822b2ant_action_a2dp(struct btc_coexist *btcoexist)
 							     NORMAL_EXEC, 5);
 
 		} else {
-			if (wifi_turbo)
-				halbtc8822b2ant_coex_table_with_type(
-					btcoexist, NORMAL_EXEC, 10);
-			else
-				halbtc8822b2ant_coex_table_with_type(
-					btcoexist, NORMAL_EXEC, 10);
+			halbtc8822b2ant_coex_table_with_type(btcoexist,
+							     NORMAL_EXEC, 10);
 
 			halbtc8822b2ant_ps_tdma(btcoexist, NORMAL_EXEC, true,
 						109);
--

2.7.4

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

#3 lore raw
Quoted 19 lines · Santha Meena Ramamoorthy
Quoted 18 lines · Julia Lawall
Quoted 2 lines · Santha Meena Ramamoorthy

Remove condition where if and else branch are functionally identical. Issue found using cond_no_effect.cocci Coccinelle script.

Actually, there are just identical, period. It would be good to remove "functionally".

Since having such code that is completely duplicated is a little bit strange, it could be good to enlarge the recipient list to:

Ping-Ke Shih <[email protected]> (commit_signer:1/1=100%,authored:1/1=100%,added_lines:5225/5225=100%) Larry Finger <[email protected]> (commit_signer:1/1=100%) [email protected] (open list:STAGING SUBSYSTEM)

Quoted 8 lines
Quoted 5 lines

Maybe someone out there would know if actually some different arguments were intended.

julia

Hi,

Sure, I will do it now. I guess that should be v2 of the patch.

Yes. Change to the commit message and adding new recipients.

julia

Quoted 36 lines
Quoted 35 lines
Quoted 35 lines
---
 drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c +2 -7
index ffff5b0..5b82640 100644
@@ -2885,12 +2885,8 @@ static void halbtc8822b2ant_action_a2dp(struct btc_coexist *btcoexist)
 							     NORMAL_EXEC, 5);
 
 		} else {
-			if (wifi_turbo)
-				halbtc8822b2ant_coex_table_with_type(
-					btcoexist, NORMAL_EXEC, 10);
-			else
-				halbtc8822b2ant_coex_table_with_type(
-					btcoexist, NORMAL_EXEC, 10);
+			halbtc8822b2ant_coex_table_with_type(btcoexist,
+							     NORMAL_EXEC, 10);
 
 			halbtc8822b2ant_ps_tdma(btcoexist, NORMAL_EXEC, true,
 						109);
--

2.7.4

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

#4 lore raw
Quoted 28 lines · Julia Lawall
Quoted 24 lines · Santha Meena Ramamoorthy
Quoted 23 lines · Julia Lawall
Quoted 2 lines · Santha Meena Ramamoorthy

Remove condition where if and else branch are functionally identical. Issue found using cond_no_effect.cocci Coccinelle script.

Actually, there are just identical, period. It would be good to remove "functionally".

Since having such code that is completely duplicated is a little bit strange, it could be good to enlarge the recipient list to:

Ping-Ke Shih <[email protected]> (commit_signer:1/1=100%,authored:1/1=100%,added_lines:5225/5225=100%) Larry Finger <[email protected]> (commit_signer:1/1=100%) [email protected] (open list:STAGING SUBSYSTEM)

Maybe someone out there would know if actually some different arguments were intended.

julia

Quoted 7 lines
Quoted 3 lines

Hi,

Sure, I will do it now. I guess that should be v2 of the patch.

Yes. Change to the commit message and adding new recipients.

julia

Thank you!

Quoted 37 lines
Quoted 37 lines
Quoted 36 lines
Quoted 36 lines
---
 drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c +2 -7
index ffff5b0..5b82640 100644
@@ -2885,12 +2885,8 @@ static void halbtc8822b2ant_action_a2dp(struct btc_coexist *btcoexist)
 							     NORMAL_EXEC, 5);
 
 		} else {
-			if (wifi_turbo)
-				halbtc8822b2ant_coex_table_with_type(
-					btcoexist, NORMAL_EXEC, 10);
-			else
-				halbtc8822b2ant_coex_table_with_type(
-					btcoexist, NORMAL_EXEC, 10);
+			halbtc8822b2ant_coex_table_with_type(btcoexist,
+							     NORMAL_EXEC, 10);
 
 			halbtc8822b2ant_ps_tdma(btcoexist, NORMAL_EXEC, true,
 						109);
--

2.7.4

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