All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: rtl8188eu: Remove redundant if condition
@ 2015-02-23 10:42 Vatika Harlalka
  2015-02-23 10:51 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 2+ messages in thread
From: Vatika Harlalka @ 2015-02-23 10:42 UTC (permalink / raw)
  To: outreachy-kernel

Remove redundant if condition as !result is always false.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
 drivers/staging/rtl8188eu/hal/phy.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 341f0db..192d764 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -345,7 +345,6 @@ void phy_sw_chnl(struct adapter *adapt, u8 channel)
 {
 	struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt);
 	u8 tmpchannel = hal_data->CurrentChannel;
-	bool  result = true;
 
 	if (hal_data->rf_chip == RF_PSEUDO_11N)
 		return;
@@ -358,9 +357,6 @@ void phy_sw_chnl(struct adapter *adapt, u8 channel)
 	if ((!adapt->bDriverStopped) && (!adapt->bSurpriseRemoved)) {
 		phy_sw_chnl_callback(adapt, channel);
 
-		if (!result)
-			hal_data->CurrentChannel = tmpchannel;
-
 	} else {
 		hal_data->CurrentChannel = tmpchannel;
 	}
-- 
1.9.1



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

* Re: [Outreachy kernel] [PATCH] Staging: rtl8188eu: Remove redundant if condition
  2015-02-23 10:42 [PATCH] Staging: rtl8188eu: Remove redundant if condition Vatika Harlalka
@ 2015-02-23 10:51 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2015-02-23 10:51 UTC (permalink / raw)
  To: Vatika Harlalka; +Cc: outreachy-kernel

On Mon, 23 Feb 2015, Vatika Harlalka wrote:

> Remove redundant if condition as !result is always false.
>
> Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
> ---
>  drivers/staging/rtl8188eu/hal/phy.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
> index 341f0db..192d764 100644
> --- a/drivers/staging/rtl8188eu/hal/phy.c
> +++ b/drivers/staging/rtl8188eu/hal/phy.c
> @@ -345,7 +345,6 @@ void phy_sw_chnl(struct adapter *adapt, u8 channel)
>  {
>  	struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt);
>  	u8 tmpchannel = hal_data->CurrentChannel;
> -	bool  result = true;
>
>  	if (hal_data->rf_chip == RF_PSEUDO_11N)
>  		return;
> @@ -358,9 +357,6 @@ void phy_sw_chnl(struct adapter *adapt, u8 channel)
>  	if ((!adapt->bDriverStopped) && (!adapt->bSurpriseRemoved)) {
>  		phy_sw_chnl_callback(adapt, channel);
>
> -		if (!result)
> -			hal_data->CurrentChannel = tmpchannel;
> -

Good observation.  How did you find it?  One could suspect that someone at
some point expected phy_sw_chnl_callback to return a value, but that is a
void function.

Since you have gottten rid of this inner if, you have surely introduced a
checkpatch error about {} around single statement branches.  You could
clean up that too.

julia

>  	} else {
>  		hal_data->CurrentChannel = tmpchannel;
>  	}
> --
> 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/20150223104259.GA6583%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:[~2015-02-23 10:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-23 10:42 [PATCH] Staging: rtl8188eu: Remove redundant if condition Vatika Harlalka
2015-02-23 10:51 ` [Outreachy kernel] " Julia Lawall

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.