* [PATCH v3] Remove redundant if condition
@ 2015-02-23 11:43 Vatika Harlalka
2015-02-23 19:34 ` [Outreachy kernel] " Jes Sorensen
0 siblings, 1 reply; 2+ messages in thread
From: Vatika Harlalka @ 2015-02-23 11:43 UTC (permalink / raw)
To: outreachy-kernel
Remove redundant if condition as !result is always false.
Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
Changes in v3: Removed unneeded newline after if condition to
follow kernel coding conventions.
Changes in v2: Removed {} around the outer if condition as
it has single statement.
drivers/staging/rtl8188eu/hal/phy.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 3950cb3..c20881d 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -359,7 +359,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;
@@ -369,15 +368,10 @@ void phy_sw_chnl(struct adapter *adapt, u8 channel)
hal_data->CurrentChannel = channel;
- if ((!adapt->bDriverStopped) && (!adapt->bSurpriseRemoved)) {
+ if ((!adapt->bDriverStopped) && (!adapt->bSurpriseRemoved))
phy_sw_chnl_callback(adapt, channel);
-
- if (!result)
- hal_data->CurrentChannel = tmpchannel;
-
- } else {
+ else
hal_data->CurrentChannel = tmpchannel;
- }
}
#define ODM_TXPWRTRACK_MAX_IDX_88E 6
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Outreachy kernel] [PATCH v3] Remove redundant if condition
2015-02-23 11:43 [PATCH v3] Remove redundant if condition Vatika Harlalka
@ 2015-02-23 19:34 ` Jes Sorensen
0 siblings, 0 replies; 2+ messages in thread
From: Jes Sorensen @ 2015-02-23 19:34 UTC (permalink / raw)
To: Vatika Harlalka, outreachy-kernel
On 02/23/15 06:43, Vatika Harlalka wrote:
> Remove redundant if condition as !result is always false.
>
> Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
> ---
> Changes in v3: Removed unneeded newline after if condition to
> follow kernel coding conventions.
> Changes in v2: Removed {} around the outer if condition as
> it has single statement.
>
> drivers/staging/rtl8188eu/hal/phy.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
The patch is good, the commit message is good, however the subject needs
to include "staging: rtl8188eu: ....". You need to repost a v4 to cover
this.
Cheers,
Jes
> diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
> index 3950cb3..c20881d 100644
> --- a/drivers/staging/rtl8188eu/hal/phy.c
> +++ b/drivers/staging/rtl8188eu/hal/phy.c
> @@ -359,7 +359,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;
> @@ -369,15 +368,10 @@ void phy_sw_chnl(struct adapter *adapt, u8 channel)
>
> hal_data->CurrentChannel = channel;
>
> - if ((!adapt->bDriverStopped) && (!adapt->bSurpriseRemoved)) {
> + if ((!adapt->bDriverStopped) && (!adapt->bSurpriseRemoved))
> phy_sw_chnl_callback(adapt, channel);
> -
> - if (!result)
> - hal_data->CurrentChannel = tmpchannel;
> -
> - } else {
> + else
> hal_data->CurrentChannel = tmpchannel;
> - }
> }
>
> #define ODM_TXPWRTRACK_MAX_IDX_88E 6
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-23 19:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-23 11:43 [PATCH v3] Remove redundant if condition Vatika Harlalka
2015-02-23 19:34 ` [Outreachy kernel] " Jes Sorensen
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.