All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtlwifi: remove condition where it has no effect
@ 2018-03-02  9:54 Santha Meena Ramamoorthy
  2018-03-02 10:03 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 5+ messages in thread
From: Santha Meena Ramamoorthy @ 2018-03-02  9:54 UTC (permalink / raw)
  To: gregkh, outreachy-kernel; +Cc: Santha Meena Ramamoorthy

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

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
---
 drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c b/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c
index ffff5b0..5b82640 100644
--- a/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c
+++ b/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c
@@ -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



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

* Re: [Outreachy kernel] [PATCH] staging: rtlwifi: remove condition where it has no effect
  2018-03-02  9:54 [PATCH] staging: rtlwifi: remove condition where it has no effect Santha Meena Ramamoorthy
@ 2018-03-02 10:03 ` Julia Lawall
  2018-03-02 10:08   ` Santha Meena Ramamoorthy
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2018-03-02 10:03 UTC (permalink / raw)
  To: Santha Meena Ramamoorthy; +Cc: gregkh, outreachy-kernel



On Fri, 2 Mar 2018, Santha Meena Ramamoorthy wrote:

> 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 <pkshih@realtek.com>
(commit_signer:1/1=100%,authored:1/1=100%,added_lines:5225/5225=100%)
Larry Finger <Larry.Finger@lwfinger.net> (commit_signer:1/1=100%)
devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM)

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

julia

>
> Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
> ---
>  drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c b/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c
> index ffff5b0..5b82640 100644
> --- a/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c
> +++ b/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c
> @@ -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 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/1519984441-14752-1-git-send-email-santhameena13%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [Outreachy kernel] [PATCH] staging: rtlwifi: remove condition where it has no effect
  2018-03-02 10:03 ` [Outreachy kernel] " Julia Lawall
@ 2018-03-02 10:08   ` Santha Meena Ramamoorthy
  2018-03-02 10:12     ` Julia Lawall
  0 siblings, 1 reply; 5+ messages in thread
From: Santha Meena Ramamoorthy @ 2018-03-02 10:08 UTC (permalink / raw)
  To: Julia Lawall, outreachy-kernel

On Fri, Mar 02, 2018 at 11:03:38AM +0100, Julia Lawall wrote:
> 
> 
> On Fri, 2 Mar 2018, Santha Meena Ramamoorthy wrote:
> 
> > 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 <pkshih@realtek.com>
> (commit_signer:1/1=100%,authored:1/1=100%,added_lines:5225/5225=100%)
> Larry Finger <Larry.Finger@lwfinger.net> (commit_signer:1/1=100%)
> devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM)
> 
> 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. 
> >
> > Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
> > ---
> >  drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c | 8 ++------
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c b/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c
> > index ffff5b0..5b82640 100644
> > --- a/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c
> > +++ b/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c
> > @@ -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 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/1519984441-14752-1-git-send-email-santhameena13%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >


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

* Re: [Outreachy kernel] [PATCH] staging: rtlwifi: remove condition where it has no effect
  2018-03-02 10:08   ` Santha Meena Ramamoorthy
@ 2018-03-02 10:12     ` Julia Lawall
  2018-03-02 10:25       ` Santha Meena Ramamoorthy
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2018-03-02 10:12 UTC (permalink / raw)
  To: Santha Meena Ramamoorthy; +Cc: outreachy-kernel



On Fri, 2 Mar 2018, Santha Meena Ramamoorthy wrote:

> On Fri, Mar 02, 2018 at 11:03:38AM +0100, Julia Lawall wrote:
> >
> >
> > On Fri, 2 Mar 2018, Santha Meena Ramamoorthy wrote:
> >
> > > 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 <pkshih@realtek.com>
> > (commit_signer:1/1=100%,authored:1/1=100%,added_lines:5225/5225=100%)
> > Larry Finger <Larry.Finger@lwfinger.net> (commit_signer:1/1=100%)
> > devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM)
> >
> > 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

> > >
> > > Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
> > > ---
> > >  drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c | 8 ++------
> > >  1 file changed, 2 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c b/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c
> > > index ffff5b0..5b82640 100644
> > > --- a/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c
> > > +++ b/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c
> > > @@ -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 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/1519984441-14752-1-git-send-email-santhameena13%40gmail.com.
> > > For more options, visit https://groups.google.com/d/optout.
> > >
>


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

* Re: [Outreachy kernel] [PATCH] staging: rtlwifi: remove condition where it has no effect
  2018-03-02 10:12     ` Julia Lawall
@ 2018-03-02 10:25       ` Santha Meena Ramamoorthy
  0 siblings, 0 replies; 5+ messages in thread
From: Santha Meena Ramamoorthy @ 2018-03-02 10:25 UTC (permalink / raw)
  To: Julia Lawall, outreachy-kernel

On Fri, Mar 02, 2018 at 11:12:17AM +0100, Julia Lawall wrote:
> 
> 
> On Fri, 2 Mar 2018, Santha Meena Ramamoorthy wrote:
> 
> > On Fri, Mar 02, 2018 at 11:03:38AM +0100, Julia Lawall wrote:
> > >
> > >
> > > On Fri, 2 Mar 2018, Santha Meena Ramamoorthy wrote:
> > >
> > > > 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 <pkshih@realtek.com>
> > > (commit_signer:1/1=100%,authored:1/1=100%,added_lines:5225/5225=100%)
> > > Larry Finger <Larry.Finger@lwfinger.net> (commit_signer:1/1=100%)
> > > devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM)
> > >
> > > 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

Thank you!
> 
> > > >
> > > > Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
> > > > ---
> > > >  drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c | 8 ++------
> > > >  1 file changed, 2 insertions(+), 6 deletions(-)
> > > >
> > > > diff --git a/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c b/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c
> > > > index ffff5b0..5b82640 100644
> > > > --- a/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c
> > > > +++ b/drivers/staging/rtlwifi/btcoexist/halbtc8822b2ant.c
> > > > @@ -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 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/1519984441-14752-1-git-send-email-santhameena13%40gmail.com.
> > > > For more options, visit https://groups.google.com/d/optout.
> > > >
> >


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

end of thread, other threads:[~2018-03-02 10:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-02  9:54 [PATCH] staging: rtlwifi: remove condition where it has no effect Santha Meena Ramamoorthy
2018-03-02 10:03 ` [Outreachy kernel] " Julia Lawall
2018-03-02 10:08   ` Santha Meena Ramamoorthy
2018-03-02 10:12     ` Julia Lawall
2018-03-02 10:25       ` Santha Meena Ramamoorthy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.