Commit 0ad02fa8 authored by Georgiana Chelu's avatar Georgiana Chelu Committed by Greg Kroah-Hartman

Staging: rtl8723bs: core: Remove boolean comparison

Remove comparison to bool in order to improve
the clearness of the code.

Issue found using coccinelle script.
Signed-off-by: default avatarGeorgiana Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f4052efe
...@@ -510,7 +510,7 @@ void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext) ...@@ -510,7 +510,7 @@ void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext)
if (!padapter) if (!padapter)
return; return;
if (padapter->bDriverStopped == true) { if (padapter->bDriverStopped) {
del_timer_sync(&pmlmeext->survey_timer); del_timer_sync(&pmlmeext->survey_timer);
del_timer_sync(&pmlmeext->link_timer); del_timer_sync(&pmlmeext->link_timer);
/* del_timer_sync(&pmlmeext->ADDBA_timer); */ /* del_timer_sync(&pmlmeext->ADDBA_timer); */
...@@ -582,7 +582,7 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame) ...@@ -582,7 +582,7 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
switch (GetFrameSubType(pframe)) { switch (GetFrameSubType(pframe)) {
case WIFI_AUTH: case WIFI_AUTH:
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
ptable->func = &OnAuth; ptable->func = &OnAuth;
else else
ptable->func = &OnAuthClient; ptable->func = &OnAuthClient;
...@@ -637,8 +637,8 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame) ...@@ -637,8 +637,8 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame)
/* DBG_871X("+OnProbeReq\n"); */ /* DBG_871X("+OnProbeReq\n"); */
#ifdef CONFIG_AUTO_AP_MODE #ifdef CONFIG_AUTO_AP_MODE
if (check_fwstate(pmlmepriv, _FW_LINKED) == true && if (check_fwstate(pmlmepriv, _FW_LINKED) &&
pmlmepriv->cur_network.join_res == true) { pmlmepriv->cur_network.join_res) {
struct sta_info *psta; struct sta_info *psta;
u8 *mac_addr, *peer_addr; u8 *mac_addr, *peer_addr;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
...@@ -752,7 +752,7 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame) ...@@ -752,7 +752,7 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame)
/* check (wildcard) SSID */ /* check (wildcard) SSID */
if (p != NULL) { if (p != NULL) {
if (is_valid_p2p_probereq == true) if (is_valid_p2p_probereq)
goto _issue_probersp; goto _issue_probersp;
if ((ielen != 0 && false == !memcmp((void *)(p+2), (void *)cur->Ssid.Ssid, cur->Ssid.SsidLength)) if ((ielen != 0 && false == !memcmp((void *)(p+2), (void *)cur->Ssid.Ssid, cur->Ssid.SsidLength))
...@@ -761,8 +761,8 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame) ...@@ -761,8 +761,8 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame)
return _SUCCESS; return _SUCCESS;
_issue_probersp: _issue_probersp:
if (((check_fwstate(pmlmepriv, _FW_LINKED) == true && if ((check_fwstate(pmlmepriv, _FW_LINKED) &&
pmlmepriv->cur_network.join_res == true)) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) { pmlmepriv->cur_network.join_res) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
/* DBG_871X("+issue_probersp during ap mode\n"); */ /* DBG_871X("+issue_probersp during ap mode\n"); */
issue_probersp(padapter, get_sa(pframe), is_valid_p2p_probereq); issue_probersp(padapter, get_sa(pframe), is_valid_p2p_probereq);
} }
...@@ -1773,7 +1773,7 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame) ...@@ -1773,7 +1773,7 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame)
DBG_871X("%s Reason code(%d)\n", __func__, reason); DBG_871X("%s Reason code(%d)\n", __func__, reason);
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
struct sta_info *psta; struct sta_info *psta;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
...@@ -1848,7 +1848,7 @@ unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame) ...@@ -1848,7 +1848,7 @@ unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame)
DBG_871X("%s Reason code(%d)\n", __func__, reason); DBG_871X("%s Reason code(%d)\n", __func__, reason);
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
struct sta_info *psta; struct sta_info *psta;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
...@@ -1976,7 +1976,7 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra ...@@ -1976,7 +1976,7 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra
/* process_addba_req(padapter, (u8 *)&(pmlmeinfo->ADDBA_req), GetAddr3Ptr(pframe)); */ /* process_addba_req(padapter, (u8 *)&(pmlmeinfo->ADDBA_req), GetAddr3Ptr(pframe)); */
process_addba_req(padapter, (u8 *)&(pmlmeinfo->ADDBA_req), addr); process_addba_req(padapter, (u8 *)&(pmlmeinfo->ADDBA_req), addr);
if (pmlmeinfo->bAcceptAddbaReq == true) { if (pmlmeinfo->bAcceptAddbaReq) {
issue_action_BA(padapter, addr, RTW_WLAN_ACTION_ADDBA_RESP, 0); issue_action_BA(padapter, addr, RTW_WLAN_ACTION_ADDBA_RESP, 0);
} else{ } else{
issue_action_BA(padapter, addr, RTW_WLAN_ACTION_ADDBA_RESP, 37);/* reject ADDBA Req */ issue_action_BA(padapter, addr, RTW_WLAN_ACTION_ADDBA_RESP, 37);/* reject ADDBA Req */
...@@ -2350,8 +2350,8 @@ void update_mgntframe_attrib_addr(struct adapter *padapter, struct xmit_frame *p ...@@ -2350,8 +2350,8 @@ void update_mgntframe_attrib_addr(struct adapter *padapter, struct xmit_frame *p
void dump_mgntframe(struct adapter *padapter, struct xmit_frame *pmgntframe) void dump_mgntframe(struct adapter *padapter, struct xmit_frame *pmgntframe)
{ {
if (padapter->bSurpriseRemoved == true || if (padapter->bSurpriseRemoved ||
padapter->bDriverStopped == true) { padapter->bDriverStopped) {
rtw_free_xmitbuf(&padapter->xmitpriv, pmgntframe->pxmitbuf); rtw_free_xmitbuf(&padapter->xmitpriv, pmgntframe->pxmitbuf);
rtw_free_xmitframe(&padapter->xmitpriv, pmgntframe); rtw_free_xmitframe(&padapter->xmitpriv, pmgntframe);
return; return;
...@@ -2368,8 +2368,8 @@ s32 dump_mgntframe_and_wait(struct adapter *padapter, struct xmit_frame *pmgntfr ...@@ -2368,8 +2368,8 @@ s32 dump_mgntframe_and_wait(struct adapter *padapter, struct xmit_frame *pmgntfr
struct xmit_buf *pxmitbuf = pmgntframe->pxmitbuf; struct xmit_buf *pxmitbuf = pmgntframe->pxmitbuf;
struct submit_ctx sctx; struct submit_ctx sctx;
if (padapter->bSurpriseRemoved == true || if (padapter->bSurpriseRemoved ||
padapter->bDriverStopped == true) { padapter->bDriverStopped) {
rtw_free_xmitbuf(&padapter->xmitpriv, pmgntframe->pxmitbuf); rtw_free_xmitbuf(&padapter->xmitpriv, pmgntframe->pxmitbuf);
rtw_free_xmitframe(&padapter->xmitpriv, pmgntframe); rtw_free_xmitframe(&padapter->xmitpriv, pmgntframe);
return ret; return ret;
...@@ -2397,8 +2397,8 @@ s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmg ...@@ -2397,8 +2397,8 @@ s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmg
u32 timeout_ms = 500;/* 500ms */ u32 timeout_ms = 500;/* 500ms */
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
if (padapter->bSurpriseRemoved == true || if (padapter->bSurpriseRemoved ||
padapter->bDriverStopped == true) { padapter->bDriverStopped) {
rtw_free_xmitbuf(&padapter->xmitpriv, pmgntframe->pxmitbuf); rtw_free_xmitbuf(&padapter->xmitpriv, pmgntframe->pxmitbuf);
rtw_free_xmitframe(&padapter->xmitpriv, pmgntframe); rtw_free_xmitframe(&padapter->xmitpriv, pmgntframe);
return -1; return -1;
...@@ -3394,7 +3394,7 @@ void issue_assocreq(struct adapter *padapter) ...@@ -3394,7 +3394,7 @@ void issue_assocreq(struct adapter *padapter)
pframe = rtw_set_ie(pframe, EID_WPA2, pIE->Length, pIE->data, &(pattrib->pktlen)); pframe = rtw_set_ie(pframe, EID_WPA2, pIE->Length, pIE->data, &(pattrib->pktlen));
break; break;
case EID_HTCapability: case EID_HTCapability:
if (padapter->mlmepriv.htpriv.ht_option == true) { if (padapter->mlmepriv.htpriv.ht_option) {
if (!(is_ap_in_tkip(padapter))) { if (!(is_ap_in_tkip(padapter))) {
memcpy(&(pmlmeinfo->HT_caps), pIE->data, sizeof(struct HT_caps_element)); memcpy(&(pmlmeinfo->HT_caps), pIE->data, sizeof(struct HT_caps_element));
pframe = rtw_set_ie(pframe, EID_HTCapability, pIE->Length, (u8 *)(&(pmlmeinfo->HT_caps)), &(pattrib->pktlen)); pframe = rtw_set_ie(pframe, EID_HTCapability, pIE->Length, (u8 *)(&(pmlmeinfo->HT_caps)), &(pattrib->pktlen));
...@@ -3403,7 +3403,7 @@ void issue_assocreq(struct adapter *padapter) ...@@ -3403,7 +3403,7 @@ void issue_assocreq(struct adapter *padapter)
break; break;
case EID_EXTCapability: case EID_EXTCapability:
if (padapter->mlmepriv.htpriv.ht_option == true) if (padapter->mlmepriv.htpriv.ht_option)
pframe = rtw_set_ie(pframe, EID_EXTCapability, pIE->Length, pIE->data, &(pattrib->pktlen)); pframe = rtw_set_ie(pframe, EID_EXTCapability, pIE->Length, pIE->data, &(pattrib->pktlen));
break; break;
default: default:
...@@ -4219,7 +4219,7 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr) ...@@ -4219,7 +4219,7 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr)
if (initiator == 0) {/* recipient */ if (initiator == 0) {/* recipient */
for (tid = 0; tid < MAXTID; tid++) { for (tid = 0; tid < MAXTID; tid++) {
if (psta->recvreorder_ctrl[tid].enable == true) { if (psta->recvreorder_ctrl[tid].enable) {
DBG_871X("rx agg disable tid(%d)\n", tid); DBG_871X("rx agg disable tid(%d)\n", tid);
issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid << 1) | initiator)&0x1F)); issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid << 1) | initiator)&0x1F));
psta->recvreorder_ctrl[tid].enable = false; psta->recvreorder_ctrl[tid].enable = false;
...@@ -4408,7 +4408,7 @@ void site_survey(struct adapter *padapter) ...@@ -4408,7 +4408,7 @@ void site_survey(struct adapter *padapter)
Restore_DM_Func_Flag(padapter); Restore_DM_Func_Flag(padapter);
/* Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); */ /* Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); */
if (is_client_associated_to_ap(padapter) == true) if (is_client_associated_to_ap(padapter))
issue_nulldata(padapter, NULL, 0, 3, 500); issue_nulldata(padapter, NULL, 0, 3, 500);
val8 = 0; /* survey done */ val8 = 0; /* survey done */
...@@ -5445,7 +5445,7 @@ static void rtw_mlmeext_disconnect(struct adapter *padapter) ...@@ -5445,7 +5445,7 @@ static void rtw_mlmeext_disconnect(struct adapter *padapter)
pmlmeinfo->state = WIFI_FW_NULL_STATE; pmlmeinfo->state = WIFI_FW_NULL_STATE;
if (state_backup == WIFI_FW_STATION_STATE) { if (state_backup == WIFI_FW_STATION_STATE) {
if (rtw_port_switch_chk(padapter) == true) { if (rtw_port_switch_chk(padapter)) {
rtw_hal_set_hwreg(padapter, HW_VAR_PORT_SWITCH, NULL); rtw_hal_set_hwreg(padapter, HW_VAR_PORT_SWITCH, NULL);
{ {
struct adapter *port0_iface = dvobj_get_port0_adapter(adapter_to_dvobj(padapter)); struct adapter *port0_iface = dvobj_get_port0_adapter(adapter_to_dvobj(padapter));
...@@ -5534,7 +5534,7 @@ void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res) ...@@ -5534,7 +5534,7 @@ void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res)
rtw_hal_macid_wakeup(padapter, psta->mac_id); rtw_hal_macid_wakeup(padapter, psta->mac_id);
} }
if (rtw_port_switch_chk(padapter) == true) if (rtw_port_switch_chk(padapter))
rtw_hal_set_hwreg(padapter, HW_VAR_PORT_SWITCH, NULL); rtw_hal_set_hwreg(padapter, HW_VAR_PORT_SWITCH, NULL);
join_type = 2; join_type = 2;
...@@ -5659,7 +5659,7 @@ void _linked_info_dump(struct adapter *padapter) ...@@ -5659,7 +5659,7 @@ void _linked_info_dump(struct adapter *padapter)
} }
for (i = 0; i < NUM_STA; i++) { for (i = 0; i < NUM_STA; i++) {
if (pdvobj->macid[i] == true) { if (pdvobj->macid[i]) {
if (i != 1) /* skip bc/mc sta */ if (i != 1) /* skip bc/mc sta */
/* tx info ============ */ /* tx info ============ */
rtw_hal_get_def_var(padapter, HW_DEF_RA_INFO_DUMP, &i); rtw_hal_get_def_var(padapter, HW_DEF_RA_INFO_DUMP, &i);
...@@ -5842,7 +5842,7 @@ void survey_timer_hdl(struct adapter *padapter) ...@@ -5842,7 +5842,7 @@ void survey_timer_hdl(struct adapter *padapter)
pmlmeext->sitesurvey_res.channel_idx++; pmlmeext->sitesurvey_res.channel_idx++;
} }
if (pmlmeext->scan_abort == true) { if (pmlmeext->scan_abort) {
{ {
pmlmeext->sitesurvey_res.channel_idx = pmlmeext->sitesurvey_res.ch_num; pmlmeext->sitesurvey_res.channel_idx = pmlmeext->sitesurvey_res.ch_num;
DBG_871X("%s idx:%d\n", __func__ DBG_871X("%s idx:%d\n", __func__
...@@ -5933,7 +5933,7 @@ void addba_timer_hdl(struct sta_info *psta) ...@@ -5933,7 +5933,7 @@ void addba_timer_hdl(struct sta_info *psta)
phtpriv = &psta->htpriv; phtpriv = &psta->htpriv;
if ((phtpriv->ht_option == true) && (phtpriv->ampdu_enable == true)) { if (phtpriv->ht_option && phtpriv->ampdu_enable) {
if (phtpriv->candidate_tid_bitmap) if (phtpriv->candidate_tid_bitmap)
phtpriv->candidate_tid_bitmap = 0x0; phtpriv->candidate_tid_bitmap = 0x0;
...@@ -5946,7 +5946,7 @@ void sa_query_timer_hdl(struct adapter *padapter) ...@@ -5946,7 +5946,7 @@ void sa_query_timer_hdl(struct adapter *padapter)
/* disconnect */ /* disconnect */
spin_lock_bh(&pmlmepriv->lock); spin_lock_bh(&pmlmepriv->lock);
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
rtw_disassoc_cmd(padapter, 0, true); rtw_disassoc_cmd(padapter, 0, true);
rtw_indicate_disconnect(padapter); rtw_indicate_disconnect(padapter);
rtw_free_assoc_resources(padapter, 1); rtw_free_assoc_resources(padapter, 1);
...@@ -6084,7 +6084,7 @@ u8 setopmode_hdl(struct adapter *padapter, u8 *pbuf) ...@@ -6084,7 +6084,7 @@ u8 setopmode_hdl(struct adapter *padapter, u8 *pbuf)
rtw_auto_ap_start_beacon(padapter); rtw_auto_ap_start_beacon(padapter);
#endif #endif
if (rtw_port_switch_chk(padapter) == true) { if (rtw_port_switch_chk(padapter)) {
rtw_hal_set_hwreg(padapter, HW_VAR_PORT_SWITCH, NULL); rtw_hal_set_hwreg(padapter, HW_VAR_PORT_SWITCH, NULL);
if (psetop->mode == Ndis802_11APMode) if (psetop->mode == Ndis802_11APMode)
...@@ -6358,7 +6358,7 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_c ...@@ -6358,7 +6358,7 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_c
set_idx = rtw_ch_set_search_ch(pmlmeext->channel_set, in[i].hw_value); set_idx = rtw_ch_set_search_ch(pmlmeext->channel_set, in[i].hw_value);
if (in[i].hw_value && !(in[i].flags & RTW_IEEE80211_CHAN_DISABLED) if (in[i].hw_value && !(in[i].flags & RTW_IEEE80211_CHAN_DISABLED)
&& set_idx >= 0 && set_idx >= 0
&& rtw_mlme_band_check(padapter, in[i].hw_value) == true && rtw_mlme_band_check(padapter, in[i].hw_value)
) { ) {
if (j >= out_num) { if (j >= out_num) {
DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" out_num:%u not enough\n", DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" out_num:%u not enough\n",
...@@ -6383,7 +6383,7 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_c ...@@ -6383,7 +6383,7 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_c
DBG_871X(FUNC_ADPT_FMT" ch:%u\n", FUNC_ADPT_ARG(padapter), pmlmeext->channel_set[i].ChannelNum); DBG_871X(FUNC_ADPT_FMT" ch:%u\n", FUNC_ADPT_ARG(padapter), pmlmeext->channel_set[i].ChannelNum);
if (rtw_mlme_band_check(padapter, pmlmeext->channel_set[i].ChannelNum) == true) { if (rtw_mlme_band_check(padapter, pmlmeext->channel_set[i].ChannelNum)) {
if (j >= out_num) { if (j >= out_num) {
DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" out_num:%u not enough\n", DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" out_num:%u not enough\n",
...@@ -6435,7 +6435,7 @@ u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf) ...@@ -6435,7 +6435,7 @@ u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf)
pmlmeext->sitesurvey_res.scan_mode = pparm->scan_mode; pmlmeext->sitesurvey_res.scan_mode = pparm->scan_mode;
/* issue null data if associating to the AP */ /* issue null data if associating to the AP */
if (is_client_associated_to_ap(padapter) == true) { if (is_client_associated_to_ap(padapter)) {
pmlmeext->sitesurvey_res.state = SCAN_TXNULL; pmlmeext->sitesurvey_res.state = SCAN_TXNULL;
issue_nulldata(padapter, NULL, 1, 3, 500); issue_nulldata(padapter, NULL, 1, 3, 500);
...@@ -6767,7 +6767,7 @@ u8 chk_bmc_sleepq_hdl(struct adapter *padapter, unsigned char *pbuf) ...@@ -6767,7 +6767,7 @@ u8 chk_bmc_sleepq_hdl(struct adapter *padapter, unsigned char *pbuf)
pxmitframe->attrib.triggered = 1; pxmitframe->attrib.triggered = 1;
if (xmitframe_hiq_filter(pxmitframe) == true) if (xmitframe_hiq_filter(pxmitframe))
pxmitframe->attrib.qsel = 0x11;/* HIQ */ pxmitframe->attrib.qsel = 0x11;/* HIQ */
rtw_hal_xmitframe_enqueue(padapter, pxmitframe); rtw_hal_xmitframe_enqueue(padapter, pxmitframe);
...@@ -6809,7 +6809,7 @@ int rtw_chk_start_clnt_join(struct adapter *padapter, u8 *ch, u8 *bw, u8 *offset ...@@ -6809,7 +6809,7 @@ int rtw_chk_start_clnt_join(struct adapter *padapter, u8 *ch, u8 *bw, u8 *offset
connect_allow = false; connect_allow = false;
} }
if (connect_allow == true) { if (connect_allow) {
DBG_871X("start_join_set_ch_bw: ch =%d, bwmode =%d, ch_offset =%d\n", cur_ch, cur_bw, cur_ch_offset); DBG_871X("start_join_set_ch_bw: ch =%d, bwmode =%d, ch_offset =%d\n", cur_ch, cur_bw, cur_ch_offset);
*ch = cur_ch; *ch = cur_ch;
*bw = cur_bw; *bw = cur_bw;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment