mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-29 16:25:42 -04:00
staging: r8188eu: clean up comparsions to false
Clean up comparsions to false. x == false -> !x Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210818080854.15847-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b3cab9a174
commit
ec8554b817
@@ -1863,13 +1863,13 @@ static s32 c2h_evt_hdl(struct adapter *adapter, struct c2h_evt_hdr *c2h_evt, c2h
|
||||
if (c2h_evt_read(adapter, buf) == _SUCCESS) {
|
||||
c2h_evt = (struct c2h_evt_hdr *)buf;
|
||||
|
||||
if (filter && filter(c2h_evt->id) == false)
|
||||
if (filter && !filter(c2h_evt->id))
|
||||
goto exit;
|
||||
|
||||
ret = rtw_hal_c2h_handler(adapter, c2h_evt);
|
||||
}
|
||||
} else {
|
||||
if (filter && filter(c2h_evt->id) == false)
|
||||
if (filter && !filter(c2h_evt->id))
|
||||
goto exit;
|
||||
|
||||
ret = rtw_hal_c2h_handler(adapter, c2h_evt);
|
||||
|
||||
@@ -156,7 +156,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid)
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE)) {
|
||||
if (!memcmp(&pmlmepriv->cur_network.network.MacAddress, bssid, ETH_ALEN)) {
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false)
|
||||
if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE))
|
||||
goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */
|
||||
} else {
|
||||
rtw_disassoc_cmd(padapter, 0, true);
|
||||
|
||||
@@ -297,7 +297,7 @@ int rtw_if_up(struct adapter *padapter)
|
||||
int res;
|
||||
|
||||
if (padapter->bDriverStopped || padapter->bSurpriseRemoved ||
|
||||
(check_fwstate(&padapter->mlmepriv, _FW_LINKED) == false))
|
||||
!check_fwstate(&padapter->mlmepriv, _FW_LINKED))
|
||||
res = false;
|
||||
else
|
||||
res = true;
|
||||
@@ -708,7 +708,7 @@ void rtw_survey_event_callback(struct adapter *adapter, 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.SsidLength = 0;
|
||||
rtw_add_network(adapter, pnetwork);
|
||||
@@ -748,7 +748,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||
|
||||
if (pmlmepriv->to_join) {
|
||||
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_queue(pmlmepriv) == _SUCCESS) {
|
||||
@@ -1252,7 +1252,7 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||
struct wlan_network *cur_network = &pmlmepriv->cur_network;
|
||||
struct wlan_network *ptarget_wlan = NULL;
|
||||
|
||||
if (rtw_access_ctrl(adapter, pstassoc->macaddr) == false)
|
||||
if (!rtw_access_ctrl(adapter, pstassoc->macaddr))
|
||||
return;
|
||||
|
||||
#if defined(CONFIG_88EU_AP_MODE)
|
||||
@@ -1542,12 +1542,12 @@ static int rtw_check_join_candidate(struct mlme_priv *pmlmepriv
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (rtw_is_desired_network(adapter, competitor) == false)
|
||||
if (!rtw_is_desired_network(adapter, competitor))
|
||||
goto exit;
|
||||
|
||||
if (rtw_to_roaming(adapter) > 0) {
|
||||
if (rtw_get_passing_time_ms((u32)competitor->last_scanned) >= RTW_SCAN_RESULT_EXPIRE ||
|
||||
is_same_ess(&competitor->network, &pmlmepriv->cur_network.network) == false)
|
||||
!is_same_ess(&competitor->network, &pmlmepriv->cur_network.network))
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
@@ -421,7 +421,7 @@ void mp_stop_test(struct adapter *padapter)
|
||||
if (pmppriv->mode == MP_ON) {
|
||||
pmppriv->bSetTxPower = 0;
|
||||
spin_lock_bh(&pmlmepriv->lock);
|
||||
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false)
|
||||
if (!check_fwstate(pmlmepriv, WIFI_MP_STATE))
|
||||
goto end_of_mp_stop_test;
|
||||
|
||||
/* 3 1. disconnect psudo AdHoc */
|
||||
@@ -866,7 +866,7 @@ u32 mp_query_psd(struct adapter *pAdapter, u8 *data)
|
||||
if (!netif_running(pAdapter->pnetdev))
|
||||
return 0;
|
||||
|
||||
if (check_fwstate(&pAdapter->mlmepriv, WIFI_MP_STATE) == false)
|
||||
if (!check_fwstate(&pAdapter->mlmepriv, WIFI_MP_STATE))
|
||||
return 0;
|
||||
|
||||
if (strlen(data) == 0) { /* default value */
|
||||
|
||||
@@ -256,15 +256,15 @@ static u8 PS_RDY_CHECK(struct adapter *padapter)
|
||||
if (delta_time < LPS_DELAY_TIME)
|
||||
return false;
|
||||
|
||||
if ((check_fwstate(pmlmepriv, _FW_LINKED) == false) ||
|
||||
(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) ||
|
||||
(check_fwstate(pmlmepriv, WIFI_AP_STATE)) ||
|
||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) ||
|
||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)))
|
||||
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) ||
|
||||
check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))
|
||||
return false;
|
||||
if (pwrpriv->bInSuspend)
|
||||
return false;
|
||||
if ((padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) && (padapter->securitypriv.binstallGrpkey == false)) {
|
||||
if (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X && !padapter->securitypriv.binstallGrpkey) {
|
||||
DBG_88E("Group handshake still in progress !!!\n");
|
||||
return false;
|
||||
}
|
||||
@@ -365,7 +365,7 @@ void LPS_Enter(struct adapter *padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
|
||||
|
||||
if (PS_RDY_CHECK(padapter) == false)
|
||||
if (!PS_RDY_CHECK(padapter))
|
||||
return;
|
||||
|
||||
if (pwrpriv->bLeisurePs) {
|
||||
|
||||
@@ -1873,7 +1873,7 @@ static int recv_func_prehandle(struct adapter *padapter, struct recv_frame *rfra
|
||||
else
|
||||
padapter->mppriv.rx_pktcount++;
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE) == false) {
|
||||
if (!check_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE)) {
|
||||
ret = _FAIL;
|
||||
rtw_free_recvframe(rframe, pfree_recv_queue);/* free this recv_frame */
|
||||
goto exit;
|
||||
@@ -2035,7 +2035,7 @@ void rtw_signal_stat_timer_hdl(struct timer_list *t)
|
||||
}
|
||||
|
||||
/* 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)
|
||||
tmp_s = tmp_s / _alpha + 1;
|
||||
|
||||
@@ -893,7 +893,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
|
||||
unsigned short ht_cap_info;
|
||||
unsigned char ht_info_infos_0;
|
||||
|
||||
if (is_client_associated_to_ap(Adapter) == false)
|
||||
if (!is_client_associated_to_ap(Adapter))
|
||||
return true;
|
||||
|
||||
len = packet_len - sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
|
||||
@@ -1794,7 +1794,7 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
|
||||
spin_unlock_bh(&pxmitpriv->lock);
|
||||
#endif
|
||||
|
||||
if (rtw_hal_xmit(padapter, pxmitframe) == false)
|
||||
if (!rtw_hal_xmit(padapter, pxmitframe))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
@@ -1811,7 +1811,7 @@ int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fra
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
int bmcst = IS_MCAST(pattrib->ra);
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == false)
|
||||
if (!check_fwstate(pmlmepriv, WIFI_AP_STATE))
|
||||
return ret;
|
||||
|
||||
if (pattrib->psta)
|
||||
|
||||
@@ -606,7 +606,7 @@ void odm_DIG(struct odm_dm_struct *pDM_Odm)
|
||||
return;
|
||||
|
||||
/* add by Neil Chen to avoid PSD is processing */
|
||||
if (pDM_Odm->bDMInitialGainEnable == false)
|
||||
if (!pDM_Odm->bDMInitialGainEnable)
|
||||
return;
|
||||
|
||||
if (pDM_Odm->SupportICType == ODM_RTL8192D) {
|
||||
@@ -1342,8 +1342,8 @@ static void FindMinimumRSSI(struct adapter *pAdapter)
|
||||
struct mlme_priv *pmlmepriv = &pAdapter->mlmepriv;
|
||||
|
||||
/* 1 1.Determine the minimum RSSI */
|
||||
if ((check_fwstate(pmlmepriv, _FW_LINKED) == false) &&
|
||||
(pdmpriv->EntryMinUndecoratedSmoothedPWDB == 0))
|
||||
if (!check_fwstate(pmlmepriv, _FW_LINKED) &&
|
||||
pdmpriv->EntryMinUndecoratedSmoothedPWDB == 0)
|
||||
pdmpriv->MinUndecoratedPWDBForDM = 0;
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) /* Default port */
|
||||
pdmpriv->MinUndecoratedPWDBForDM = pdmpriv->EntryMinUndecoratedSmoothedPWDB;
|
||||
|
||||
@@ -1262,7 +1262,7 @@ static int hal_EfusePgPacketRead_8188e(struct adapter *pAdapter, u8 offset, u8 *
|
||||
bDataEmpty = false;
|
||||
}
|
||||
}
|
||||
if (bDataEmpty == false) {
|
||||
if (!bDataEmpty) {
|
||||
ReadState = PG_STATE_DATA;
|
||||
} else {/* read next header */
|
||||
efuse_addr = efuse_addr + (word_cnts * 2) + 1;
|
||||
|
||||
@@ -511,7 +511,7 @@ s32 Hal_SetThermalMeter(struct adapter *pAdapter, u8 target_ther)
|
||||
if (!netif_running(pAdapter->pnetdev))
|
||||
return _FAIL;
|
||||
|
||||
if (check_fwstate(&pAdapter->mlmepriv, WIFI_MP_STATE) == false)
|
||||
if (!check_fwstate(&pAdapter->mlmepriv, WIFI_MP_STATE))
|
||||
return _FAIL;
|
||||
|
||||
target_ther &= 0xff;
|
||||
|
||||
@@ -1065,7 +1065,7 @@ static unsigned int rtl8188eu_inirp_init(struct adapter *Adapter)
|
||||
/* issue Rx irp to receive data */
|
||||
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
|
||||
for (i = 0; i < NR_RECVBUFF; i++) {
|
||||
if (_read_port(pintfhdl, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf) == false) {
|
||||
if (!_read_port(pintfhdl, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf)) {
|
||||
status = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -820,7 +820,7 @@ static int rtw_wx_set_mode(struct net_device *dev, struct iw_request_info *a,
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
if (rtw_set_802_11_infrastructure_mode(padapter, networkType) == false) {
|
||||
if (!rtw_set_802_11_infrastructure_mode(padapter, networkType)) {
|
||||
ret = -EPERM;
|
||||
goto exit;
|
||||
}
|
||||
@@ -1088,7 +1088,7 @@ static int rtw_wx_set_wap(struct net_device *dev,
|
||||
|
||||
rtw_set_802_11_authentication_mode(padapter, authmode);
|
||||
/* set_802_11_encryption_mode(padapter, padapter->securitypriv.ndisencryptstatus); */
|
||||
if (rtw_set_802_11_bssid(padapter, temp->sa_data) == false) {
|
||||
if (!rtw_set_802_11_bssid(padapter, temp->sa_data)) {
|
||||
ret = -1;
|
||||
goto exit;
|
||||
}
|
||||
@@ -1461,7 +1461,7 @@ static int rtw_wx_set_essid(struct net_device *dev,
|
||||
}
|
||||
spin_unlock_bh(&queue->lock);
|
||||
rtw_set_802_11_authentication_mode(padapter, authmode);
|
||||
if (rtw_set_802_11_ssid(padapter, &ndis_ssid) == false) {
|
||||
if (!rtw_set_802_11_ssid(padapter, &ndis_ssid)) {
|
||||
ret = -1;
|
||||
goto exit;
|
||||
}
|
||||
@@ -1797,7 +1797,7 @@ static int rtw_wx_set_enc(struct net_device *dev,
|
||||
|
||||
memcpy(wep.KeyMaterial, keybuf, wep.KeyLength);
|
||||
|
||||
if (rtw_set_802_11_add_wep(padapter, &wep) == false) {
|
||||
if (!rtw_set_802_11_add_wep(padapter, &wep)) {
|
||||
if (rf_on == pwrpriv->rf_pwrstate)
|
||||
ret = -EOPNOTSUPP;
|
||||
goto exit;
|
||||
|
||||
@@ -221,7 +221,7 @@ int rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev)
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
s32 res = 0;
|
||||
|
||||
if (rtw_if_up(padapter) == false)
|
||||
if (!rtw_if_up(padapter))
|
||||
goto drop_packet;
|
||||
|
||||
rtw_check_xmit_resource(padapter, pkt);
|
||||
|
||||
Reference in New Issue
Block a user