Staging: rtl8188eu: Remove redundant if condition
PATCH 1/1 Staging: rtl8188eu: Remove redundant if condition
Remove redundant if condition as !result is always false.
--- drivers/staging/rtl8188eu/hal/phy.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/staging/rtl8188eu/hal/phy.c +0 -4
@@ -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; }
Signature · 1 line
1.9.1
Quoted 20 lines · Vatika Harlalka
Remove redundant if condition as !result is always false.
Signed-off-by Vatika Harlalka <[email protected]>--- drivers/staging/rtl8188eu/hal/phy.c | 4 ---- 1 file changed, 4 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 363
Quoted 6 lines
drivers/staging/rtl8188eu/hal/phy.c +0
-3@@ -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
Quoted 13 lines
drivers/staging/rtl8188eu/hal/phy.c +0
-1}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 [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/20150223104259.GA6583%40gmail.com.
For more options, visit https://groups.google.com/d/optout.