diff options
author | Michael Straube <straube.linux@gmail.com> | 2020-01-14 14:44:18 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-14 14:59:47 +0100 |
commit | c0a6bf0f1ae33eddd36e8201ef132c1abc4c19bf (patch) | |
tree | 45b4db80d7d005702e25a2550c7c77f1652887c2 /drivers/staging/rtl8188eu | |
parent | 98ab51df76bf4a317a0116d6c940fa08c6f12322 (diff) |
staging: rtl8188eu: refactor rtw_hal_antdiv_before_linked()
Refactor rtw_hal_antdiv_before_linked() to clear checkpatch warnings.
WARNING: line over 80 characters
WARNING: else is not generally useful after a break or return
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200114134422.13598-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu')
-rw-r--r-- | drivers/staging/rtl8188eu/hal/rtl8188e_dm.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c index 545d6a6102f1..0aa5e9346787 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c @@ -197,15 +197,16 @@ u8 rtw_hal_antdiv_before_linked(struct adapter *Adapter) if (check_fwstate(pmlmepriv, _FW_LINKED)) return false; - if (dm_swat_tbl->SWAS_NoLink_State == 0) { - /* switch channel */ - dm_swat_tbl->SWAS_NoLink_State = 1; - dm_swat_tbl->CurAntenna = (dm_swat_tbl->CurAntenna == Antenna_A) ? Antenna_B : Antenna_A; - - rtw_antenna_select_cmd(Adapter, dm_swat_tbl->CurAntenna, false); - return true; - } else { + if (dm_swat_tbl->SWAS_NoLink_State != 0) { dm_swat_tbl->SWAS_NoLink_State = 0; return false; } + + /* switch channel */ + dm_swat_tbl->SWAS_NoLink_State = 1; + dm_swat_tbl->CurAntenna = (dm_swat_tbl->CurAntenna == Antenna_A) ? + Antenna_B : Antenna_A; + + rtw_antenna_select_cmd(Adapter, dm_swat_tbl->CurAntenna, false); + return true; } |