Staging: rtl8188eu: Remove redundant if condition
PATCH v2 1/1 Staging: rtl8188eu: Remove redundant if condition
Remove redundant if condition as !result is always false.
---
Changes in v2: Removed {} around the outer if condition as
it has single statement.
drivers/staging/rtl8188eu/hal/phy.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/staging/rtl8188eu/hal/phy.c +2 -7
@@ -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 ;
@@ -355,15 +354,11 @@ 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
Signature · 1 line
1.9.1
Quoted 23 lines · Vatika Harlalka
Remove redundant if condition as !result is always false.
Signed-off-by Vatika Harlalka <[email protected]>---
Changes in v2: Removed {} around the outer if condition as
it has single statement.drivers/staging/rtl8188eu/hal/phy.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)drivers/staging/rtl8188eu/hal/phy.c +0
-1@@ -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 ;
drivers/staging/rtl8188eu/hal/phy.c void phy_sw_chnl(struct adapter *adapt, u8 channel) · line 359
Quoted 7 lines
drivers/staging/rtl8188eu/hal/phy.c +1
-1@@ -355,15 +354,11 @@ 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);
I should have mentioned it before, but I don't think you need the blank line either.
julia
Quoted 20 lines
drivers/staging/rtl8188eu/hal/phy.c +1
-6-if (!result) - hal_data->CurrentChannel = tmpchannel; - - }else { +else hal_data->CurrentChannel = tmpchannel; - } }#define ODM_TXPWRTRACK_MAX_IDX_88E 6 --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 [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/20150223112513.GA6967%40gmail.com.
For more options, visit https://groups.google.com/d/optout.