From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> In addition, remove a followon check for false just after having checked for true. Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> --- drivers/staging/rtl8723au/core/rtw_ioctl_set.c | 3 +-- drivers/staging/rtl8723au/core/rtw_led.c | 17 ++++++----------- drivers/staging/rtl8723au/core/rtw_mlme.c | 6 +++--- drivers/staging/rtl8723au/core/rtw_pwrctrl.c | 2 +- drivers/staging/rtl8723au/core/rtw_recv.c | 3 +-- drivers/staging/rtl8723au/core/rtw_xmit.c | 4 ++-- 6 files changed, 14 insertions(+), 21 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ioctl_set.c b/drivers/staging/rtl8723au/core/rtw_ioctl_set.c index ff740af..cf897c7 100644 --- a/drivers/staging/rtl8723au/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8723au/core/rtw_ioctl_set.c @@ -187,8 +187,7 @@ int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter, if ((pmlmepriv->assoc_ssid.ssid_len == ssid->ssid_len) && !memcmp(&pmlmepriv->assoc_ssid.ssid, ssid->ssid, ssid->ssid_len)) { - if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false)) - { + if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("Set SSID is the same ssid, fw_state = 0x%08x\n", get_fwstate(pmlmepriv))); diff --git a/drivers/staging/rtl8723au/core/rtw_led.c b/drivers/staging/rtl8723au/core/rtw_led.c index c433768..e21a42c5 100644 --- a/drivers/staging/rtl8723au/core/rtw_led.c +++ b/drivers/staging/rtl8723au/core/rtw_led.c @@ -234,7 +234,7 @@ static void SwLedBlink1(struct led_8723a *pLed) pLed->BlinkingLedState = RTW_LED_ON; delay = LED_BLINK_LINK_INTERVAL_ALPHA; RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); - } else if (check_fwstate(pmlmepriv, _FW_LINKED) == false) { + } else { pLed->bLedNoLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_SLOWLY; if (pLed->bLedOn) @@ -267,8 +267,7 @@ static void SwLedBlink1(struct led_8723a *pLed) pLed->BlinkingLedState = RTW_LED_ON; delay = LED_BLINK_LINK_INTERVAL_ALPHA; RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); - } else if (check_fwstate(pmlmepriv, - _FW_LINKED) == false) { + } else { pLed->bLedNoLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_SLOWLY; if (pLed->bLedOn) @@ -354,7 +353,7 @@ static void SwLedBlink2(struct led_8723a *pLed) RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("stop scan blink CurrLedState %d\n", pLed->CurrLedState)); - } else if (!check_fwstate(pmlmepriv, _FW_LINKED)) { + } else { pLed->CurrLedState = RTW_LED_OFF; pLed->BlinkingLedState = RTW_LED_OFF; SwLedOff23a(padapter, pLed); @@ -390,7 +389,7 @@ static void SwLedBlink2(struct led_8723a *pLed) RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("stop CurrLedState %d\n", pLed->CurrLedState)); - } else if (!check_fwstate(pmlmepriv, _FW_LINKED)) { + } else { pLed->CurrLedState = RTW_LED_OFF; pLed->BlinkingLedState = RTW_LED_OFF; SwLedOff23a(padapter, pLed); @@ -457,9 +456,7 @@ static void SwLedBlink3(struct led_8723a *pLed) SwLedOn23a(padapter, pLed); RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); - } - else if (check_fwstate(pmlmepriv, _FW_LINKED) == false) - { + } else { pLed->CurrLedState = RTW_LED_OFF; pLed->BlinkingLedState = RTW_LED_OFF; if (pLed->bLedOn) @@ -507,9 +504,7 @@ static void SwLedBlink3(struct led_8723a *pLed) SwLedOn23a(padapter, pLed); RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); - } - else if (check_fwstate(pmlmepriv, _FW_LINKED) == false) - { + } else { pLed->CurrLedState = RTW_LED_OFF; pLed->BlinkingLedState = RTW_LED_OFF; diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index 148e11f..547986a 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -221,7 +221,7 @@ int rtw_if_up23a(struct rtw_adapter *padapter) int res; if (padapter->bDriverStopped || padapter->bSurpriseRemoved || - check_fwstate(&padapter->mlmepriv, _FW_LINKED) == false) { + !check_fwstate(&padapter->mlmepriv, _FW_LINKED)) { RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_if_up23a:bDriverStopped(%d) OR " "bSurpriseRemoved(%d)", padapter->bDriverStopped, @@ -682,7 +682,7 @@ void rtw_survey_event_cb23a(struct rtw_adapter *adapter, const u8 *pbuf) } /* lock pmlmepriv->lock when you accessing network_q */ - if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == false) { + if (!check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) { if (pnetwork->Ssid.ssid[0] == 0) pnetwork->Ssid.ssid_len = 0; @@ -730,7 +730,7 @@ rtw_surveydone_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf) if (pmlmepriv->to_join == true) { if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { - if (check_fwstate(pmlmepriv, _FW_LINKED) == false) { + if (!check_fwstate(pmlmepriv, _FW_LINKED)) { set_fwstate(pmlmepriv, _FW_UNDER_LINKING); if (rtw_select_and_join_from_scanned_queue23a( diff --git a/drivers/staging/rtl8723au/core/rtw_pwrctrl.c b/drivers/staging/rtl8723au/core/rtw_pwrctrl.c index 54d7bfc..90359d1 100644 --- a/drivers/staging/rtl8723au/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8723au/core/rtw_pwrctrl.c @@ -299,7 +299,7 @@ static u8 PS_RDY_CHECK(struct rtw_adapter * padapter) if (delta_time < LPS_DELAY_TIME) return false; - if (check_fwstate(pmlmepriv, _FW_LINKED) == false || + if (!check_fwstate(pmlmepriv, _FW_LINKED) || check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) || check_fwstate(pmlmepriv, WIFI_AP_STATE) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) || diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c b/drivers/staging/rtl8723au/core/rtw_recv.c index 95e7455..f21aa20 100644 --- a/drivers/staging/rtl8723au/core/rtw_recv.c +++ b/drivers/staging/rtl8723au/core/rtw_recv.c @@ -2379,8 +2379,7 @@ void rtw_signal_stat_timer_hdl23a(unsigned long data) } /* update value of signal_strength, rssi, signal_qual */ - if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) == - false) { + if (!check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY)) { tmp_s = (avg_signal_strength + (_alpha - 1) * recvpriv->signal_strength); if (tmp_s %_alpha) diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c b/drivers/staging/rtl8723au/core/rtw_xmit.c index cdd27c4..d0dc638 100644 --- a/drivers/staging/rtl8723au/core/rtw_xmit.c +++ b/drivers/staging/rtl8723au/core/rtw_xmit.c @@ -560,7 +560,7 @@ static int update_attrib(struct rtw_adapter *padapter, pattrib->encrypt = 0; if ((pattrib->ether_type != ETH_P_PAE) && - (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false)) { + !check_fwstate(pmlmepriv, WIFI_MP_STATE)) { RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("\npsta->ieee8021x_blocked == true, " "pattrib->ether_type(%.4x) != 0x888e\n", @@ -1968,7 +1968,7 @@ int xmitframe_enqueue_for_sleeping_sta23a(struct rtw_adapter *padapter, struct x struct mlme_priv *pmlmepriv = &padapter->mlmepriv; int bmcst = is_multicast_ether_addr(pattrib->ra); - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == false) + if (!check_fwstate(pmlmepriv, WIFI_AP_STATE)) return ret; if (pattrib->psta) { -- 1.9.3 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel