Staging: rtl8723au: core: Bool tests don't need comparisons
PATCH v3 1/3 Staging: rtl8723au: core: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables.
Changes in v3-
Made fix manually
--- drivers/staging/rtl8723au/core/rtw_ap.c | 13 ++++++------- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 28 +++++++++++++-------------- 2 files changed, 20 insertions(+), 21 deletions(-)
drivers/staging/rtl8723au/core/rtw_ap.c +6 -7
@@ -409,7 +409,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l arg |=BIT (7 );/* support entry 2~31 */ -if (shortGIrate == true) +if (shortGIrate) arg |=BIT (5 ); tx_ra_bitmap |= ((raid<<28 )&0xf0000000 );
@@ -424,7 +424,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l/* arg[5] = Short GI */ rtl8723a_add_rateatid (padapter, tx_ra_bitmap, arg, rssi_level); -if (shortGIrate == true) +if (shortGIrate) init_rate |=BIT (6 );/* set ra_id, init_rate */
@@ -662,7 +662,7 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf)update_hw_ht_param (padapter); } -if (pmlmepriv->cur_network.join_res != true) { +if (!pmlmepriv->cur_network.join_res) {/* setting only at first time */ /* WEP Key will be set before this function, do not clear CAM. */ if (psecuritypriv->dot11PrivacyAlgrthm !=
@@ -1061,7 +1061,7 @@ int rtw_acl_add_sta23a(struct rtw_adapter *padapter, u8 *addr) paclnode = container_of(plist, struct rtw_wlan_acl_node, list);if (!memcmp (paclnode->addr, addr,ETH_ALEN )) { -if (paclnode->valid == true) { +if (paclnode->valid) { added = true;DBG_8723A ("%s, sta has been added\n" , __func__);break ;
@@ -1370,7 +1370,7 @@ static int rtw_ht_operation_update(struct rtw_adapter *padapter)void associated_clients_update23a (struct rtw_adapter *padapter,u8 updated) {/* update associated stations cap. */ -if (updated == true) { +if (updated) {struct list_head *phead, *plist, *ptmp;struct sta_info *psta;struct sta_priv *pstapriv = &padapter->stapriv;
@@ -1882,9 +1882,8 @@ void stop_ap_mode23a(struct rtw_adapter *padapter)list_for_each_safe (plist, ptmp, phead) { paclnode = container_of(plist, struct rtw_wlan_acl_node, list); -if (paclnode->valid == true) { +if (paclnode->valid) { paclnode->valid = false; -list_del_init (&paclnode->list); pacl_list->num--;
drivers/staging/rtl8723au/core/rtw_mlme_ext.c +14 -14
@@ -602,7 +602,7 @@ void free_mlme_ext_priv23a (struct mlme_ext_priv *pmlmeext)if (!padapter)return ; -if (padapter->bDriverStopped == true) { +if (padapter->bDriverStopped) {del_timer_sync (&pmlmeext->survey_timer);del_timer_sync (&pmlmeext->link_timer);/* del_timer_sync(&pmlmeext->ADDBA_timer); */
@@ -959,7 +959,7 @@ OnAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) goto auth_fail; } -if (rtw_access_ctrl23a (padapter, sa) == false) { +if (!rtw_access_ctrl23a (padapter, sa)) { status =WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA ; goto auth_fail; }
@@ -2049,7 +2049,7 @@ static int OnAction23a_back23a(struct rtw_adapter *padapter, sizeof(struct ADDBA_request));process_addba_req23a (padapter, (u8 *)&pmlmeinfo->ADDBA_req, addr); -if (pmlmeinfo->bAcceptAddbaReq == true) +if (pmlmeinfo->bAcceptAddbaReq)issue_action_BA23a (padapter, addr,WLAN_ACTION_ADDBA_RESP ,0 );else {
@@ -2253,8 +2253,8 @@ void update_mgntframe_attrib23a(struct rtw_adapter *padapter,void dump_mgntframe23a (struct rtw_adapter *padapter,struct xmit_frame *pmgntframe) { -if (padapter->bSurpriseRemoved == true || - padapter->bDriverStopped == true) +if (padapter->bSurpriseRemoved || + padapter->bDriverStopped)return ;rtl8723au_mgnt_xmit (padapter, pmgntframe);
@@ -2269,8 +2269,8 @@ int dump_mgntframe23a_and_wait(struct rtw_adapter *padapter,struct xmit_buf *pxmitbuf = pmgntframe->pxmitbuf;struct submit_ctx sctx; -if (padapter->bSurpriseRemoved == true || - padapter->bDriverStopped == true) +if (padapter->bSurpriseRemoved || + padapter->bDriverStopped)return ret;rtw_sctx_init23a (&sctx, timeout_ms);
@@ -2295,8 +2295,8 @@ int dump_mgntframe23a_and_wait_ack23a(struct rtw_adapter *padapter,u32 timeout_ms =500 ;/* 500ms */ struct xmit_priv *pxmitpriv = &padapter->xmitpriv; -if (padapter->bSurpriseRemoved == true || - padapter->bDriverStopped == true) +if (padapter->bSurpriseRemoved || + padapter->bDriverStopped)return _FAIL;mutex_lock (&pxmitpriv->ack_tx_mutex);
@@ -3942,7 +3942,7 @@ int send_delba23a(struct rtw_adapter *padapter, u8 initiator, u8 *addr)if (initiator ==0 ) {/* recipient */ for (tid =0 ; tid <MAXTID ; tid++) { -if (psta->recvreorder_ctrl[tid].enable == true) { +if (psta->recvreorder_ctrl[tid].enable) {DBG_8723A ("rx agg disable tid(%d)\n" , tid);issue_action_BA23a (padapter, addr,WLAN_ACTION_DELBA , (((tid <<1 ) |initiator)&0x1F )); psta->recvreorder_ctrl[tid].enable = false;
@@ -4092,7 +4092,7 @@ static void rtw_site_survey(struct rtw_adapter *padapter)/* turn on dynamic functions */ rtl8723a_odm_support_ability_restore (padapter); -if (is_client_associated_to_ap23a (padapter) == true) +if (is_client_associated_to_ap23a (padapter))issue_nulldata23a (padapter,NULL ,0 ,3 ,500 );rtl8723a_mlme_sitesurvey (padapter,0 );
@@ -5195,7 +5195,7 @@ void linked_status_chk23a(struct rtw_adapter *padapter)if (psta) {bool is_p2p_enable = false; -if (chk_ap_is_alive (padapter, psta) == false) +if (!chk_ap_is_alive (padapter, psta)) rx_chk = _FAIL;if (pxmitpriv->last_tx_pkts == pxmitpriv->tx_pkts)
@@ -5319,7 +5319,7 @@ static void survey_timer_hdl(unsigned long data)if (pmlmeext->sitesurvey_res.state ==SCAN_PROCESS ) pmlmeext->sitesurvey_res.channel_idx++; -if (pmlmeext->scan_abort == true) { +if (pmlmeext->scan_abort) { pmlmeext->sitesurvey_res.channel_idx = pmlmeext->sitesurvey_res.ch_num; DBG_8723A("%s idx:%d\n", __func__,
@@ -5823,7 +5823,7 @@ int sitesurvey_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)/* config the initial gain under scanning, need to write the BB registers */ -if (wdev_to_priv (padapter->rtw_wdev)->p2p_enabled == true) +if (wdev_to_priv (padapter->rtw_wdev)->p2p_enabled) initialgain =0x30 ;else initialgain =0x1E ;
Signature · 1 line
2.1.4
PATCH v3 2/3 Staging: vt6656: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables.
Change in v3-
Fix made manually
--- drivers/staging/vt6656/wcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6656/wcmd.c +1 -1
@@ -177,7 +177,7 @@ int vnt_schedule_command(struct vnt_private *priv, enum vnt_cmd command)ADD_ONE_WITH_WRAP_AROUND (priv->cmd_enqueue_idx,CMD_Q_SIZE ); priv->free_cmd_queue--; -if (priv->cmd_running == false) +if (!priv->cmd_running)vnt_cmd_complete (priv);return true;
Signature · 1 line
2.1.4
PATCH v3 3/3 Staging: rtl8188eu: Bool tests don't need comparisons
In reply to Shraddha BarkeThis patch removes comparisons to true/false values on bool variables.
Changes in v3-
Fix made manually
--- drivers/staging/rtl8188eu/core/rtw_cmd.c | 12 +++++------ drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 28 +++++++++++++------------- 2 files changed, 20 insertions(+), 20 deletions(-)
drivers/staging/rtl8188eu/core/rtw_cmd.c +6 -6
@@ -272,7 +272,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,struct cmd_priv *pcmdpriv = &padapter->cmdpriv;struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -if (check_fwstate (pmlmepriv, _FW_LINKED) == true) +if (check_fwstate (pmlmepriv, _FW_LINKED))rtw_lps_ctrl_wk_cmd (padapter,LPS_CTRL_SCAN ,1 ); ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC );
@@ -903,7 +903,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) pmlmepriv = &(padapter->mlmepriv);#ifdef CONFIG_88EU_AP_MODE -if (check_fwstate (pmlmepriv,WIFI_AP_STATE ) == true) +if (check_fwstate (pmlmepriv,WIFI_AP_STATE ))expire_timeout_chk (padapter);#endif
@@ -920,13 +920,13 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type)u8 mstatus; -if ((check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ) == true) || - (check_fwstate (pmlmepriv,WIFI_ADHOC_STATE ) == true)) +if ((check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE )) || + (check_fwstate (pmlmepriv,WIFI_ADHOC_STATE )))return ;switch (lps_ctrl_type) {case LPS_CTRL_SCAN : -if (check_fwstate (pmlmepriv, _FW_LINKED) == true) { +if (check_fwstate (pmlmepriv, _FW_LINKED)) {/* connect */ LPS_Leave (padapter); }
@@ -1384,7 +1384,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *spin_lock_bh (&pmlmepriv->lock); -if ((check_fwstate (pmlmepriv,WIFI_MP_STATE ) == true) && (check_fwstate (pmlmepriv, _FW_UNDER_LINKING) == true)) +if ((check_fwstate (pmlmepriv,WIFI_MP_STATE )) && (check_fwstate (pmlmepriv, _FW_UNDER_LINKING)))_clr_fwstate_ (pmlmepriv, _FW_UNDER_LINKING);set_fwstate (pmlmepriv, _FW_LINKED);
drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +14 -14
@@ -89,7 +89,7 @@ u8 rtw_do_join(struct adapter *padapter)mod_timer (&pmlmepriv->assoc_timer, jiffies +msecs_to_jiffies (MAX_JOIN_TIMEOUT )); }else { -if (check_fwstate (pmlmepriv,WIFI_ADHOC_STATE ) == true) { +if (check_fwstate (pmlmepriv,WIFI_ADHOC_STATE )) {/* submit createbss_cmd to change to a ADHOC_MASTER */ /* pmlmepriv->lock has been acquired by caller... */
@@ -162,7 +162,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid)DBG_88E ("Set BSSID under fw_state = 0x%08x\n" ,get_fwstate (pmlmepriv)); -if (check_fwstate (pmlmepriv, _FW_UNDER_SURVEY) == true) +if (check_fwstate (pmlmepriv, _FW_UNDER_SURVEY)) goto handle_tkip_countermeasure;else if (check_fwstate (pmlmepriv, _FW_UNDER_LINKING)) goto release_mlme_lock;
@@ -171,7 +171,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid)RT_TRACE (_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_bssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n" ));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 {RT_TRACE (_module_rtl871x_ioctl_set_c_, _drv_info_, ("Set BSSID not the same bssid\n" ));
@@ -180,12 +180,12 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid)rtw_disassoc_cmd (padapter,0 , true); -if (check_fwstate (pmlmepriv, _FW_LINKED) == true) +if (check_fwstate (pmlmepriv, _FW_LINKED))rtw_indicate_disconnect (padapter);rtw_free_assoc_resources (padapter); -if ((check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ) == true)) { +if ((check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ))) {_clr_fwstate_ (pmlmepriv,WIFI_ADHOC_MASTER_STATE );set_fwstate (pmlmepriv,WIFI_ADHOC_STATE ); }
@@ -248,9 +248,9 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)spin_lock_bh (&pmlmepriv->lock);DBG_88E ("Set SSID under fw_state = 0x%08x\n" ,get_fwstate (pmlmepriv)); -if (check_fwstate (pmlmepriv, _FW_UNDER_SURVEY) == true) +if (check_fwstate (pmlmepriv, _FW_UNDER_SURVEY)) goto handle_tkip_countermeasure; -else if (check_fwstate (pmlmepriv, _FW_UNDER_LINKING) == true) +else if (check_fwstate (pmlmepriv, _FW_UNDER_LINKING)) goto release_mlme_lock;if (check_fwstate (pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE )) {
@@ -268,12 +268,12 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)/* if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again */ rtw_disassoc_cmd (padapter,0 , true); -if (check_fwstate (pmlmepriv, _FW_LINKED) == true) +if (check_fwstate (pmlmepriv, _FW_LINKED))rtw_indicate_disconnect (padapter);rtw_free_assoc_resources (padapter); -if (check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ) == true) { +if (check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE )) {_clr_fwstate_ (pmlmepriv,WIFI_ADHOC_MASTER_STATE );set_fwstate (pmlmepriv,WIFI_ADHOC_STATE ); }
@@ -290,12 +290,12 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)rtw_disassoc_cmd (padapter,0 , true); -if (check_fwstate (pmlmepriv, _FW_LINKED) == true) +if (check_fwstate (pmlmepriv, _FW_LINKED))rtw_indicate_disconnect (padapter);rtw_free_assoc_resources (padapter); -if (check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ) == true) { +if (check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE )) {_clr_fwstate_ (pmlmepriv,WIFI_ADHOC_MASTER_STATE );set_fwstate (pmlmepriv,WIFI_ADHOC_STATE ); }
@@ -319,7 +319,7 @@ handle_tkip_countermeasure:memcpy (&pmlmepriv->assoc_ssid, ssid,sizeof (struct ndis_802_11_ssid )); pmlmepriv->assoc_by_bssid = false; -if (check_fwstate (pmlmepriv, _FW_UNDER_SURVEY) == true) +if (check_fwstate (pmlmepriv, _FW_UNDER_SURVEY)) pmlmepriv->to_join = true;else status =rtw_do_join (padapter);
@@ -369,7 +369,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,rtw_free_assoc_resources (padapter);if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) { -if (check_fwstate (pmlmepriv, _FW_LINKED) == true) +if (check_fwstate (pmlmepriv, _FW_LINKED))rtw_indicate_disconnect (padapter);/* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */ }
@@ -450,7 +450,7 @@ u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_s res = true;if (check_fwstate (pmlmepriv, - (_FW_UNDER_SURVEY|_FW_UNDER_LINKING)) == true) + (_FW_UNDER_SURVEY|_FW_UNDER_LINKING)))RT_TRACE (_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n###_FW_UNDER_SURVEY|_FW_UNDER_LINKING\n\n" ));else RT_TRACE (_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n###pmlmepriv->sitesurveyctrl.traffic_busy == true\n\n" ));
Signature · 1 line
2.1.4
Re: [PATCH v3 3/3] Staging: rtl8188eu: Bool tests don't need comparisons
Quoted 34 lines · Shraddha Barke
This patch removes comparisons to true/false values on bool variables.
Changes in v3-
Fix made manuallySigned-off-by Shraddha Barke <[email protected]>--- drivers/staging/rtl8188eu/core/rtw_cmd.c | 12 +++++------ drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 28 +++++++++++++------------- 2 files changed, 20 insertions(+), 20 deletions(-)drivers/staging/rtl8188eu/core/rtw_cmd.c +2
-2@@ -272,7 +272,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,struct cmd_priv *pcmdpriv = &padapter->cmdpriv;struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -if (check_fwstate (pmlmepriv, _FW_LINKED) == true) +if (check_fwstate (pmlmepriv, _FW_LINKED))rtw_lps_ctrl_wk_cmd (padapter,LPS_CTRL_SCAN ,1 ); ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC );@@ -903,7 +903,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) pmlmepriv = &(padapter->mlmepriv);#ifdef CONFIG_88EU_AP_MODE -if (check_fwstate (pmlmepriv,WIFI_AP_STATE ) == true) +if (check_fwstate (pmlmepriv,WIFI_AP_STATE ))expire_timeout_chk (padapter);#endif
drivers/staging/rtl8188eu/core/rtw_cmd.c static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type) · line 924
Quoted 7 lines
drivers/staging/rtl8188eu/core/rtw_cmd.c +2
-2@@ -920,13 +920,13 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type)u8 mstatus; -if ((check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ) == true) || - (check_fwstate (pmlmepriv,WIFI_ADHOC_STATE ) == true)) +if ((check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE )) || + (check_fwstate (pmlmepriv,WIFI_ADHOC_STATE )))
You don't need to keep the parentheses.
julia
Quoted 137 lines
drivers/staging/rtl8188eu/core/rtw_cmd.c +2
-2return ;switch (lps_ctrl_type) {case LPS_CTRL_SCAN : -if (check_fwstate (pmlmepriv, _FW_LINKED) == true) { +if (check_fwstate (pmlmepriv, _FW_LINKED)) {/* connect */ LPS_Leave (padapter); }@@ -1384,7 +1384,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *spin_lock_bh (&pmlmepriv->lock); -if ((check_fwstate (pmlmepriv,WIFI_MP_STATE ) == true) && (check_fwstate (pmlmepriv, _FW_UNDER_LINKING) == true)) +if ((check_fwstate (pmlmepriv,WIFI_MP_STATE )) && (check_fwstate (pmlmepriv, _FW_UNDER_LINKING)))_clr_fwstate_ (pmlmepriv, _FW_UNDER_LINKING);set_fwstate (pmlmepriv, _FW_LINKED);drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +14
-14@@ -89,7 +89,7 @@ u8 rtw_do_join(struct adapter *padapter)mod_timer (&pmlmepriv->assoc_timer, jiffies +msecs_to_jiffies (MAX_JOIN_TIMEOUT )); }else { -if (check_fwstate (pmlmepriv,WIFI_ADHOC_STATE ) == true) { +if (check_fwstate (pmlmepriv,WIFI_ADHOC_STATE )) {/* submit createbss_cmd to change to a ADHOC_MASTER */ /* pmlmepriv->lock has been acquired by caller... */ @@ -162,7 +162,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid)DBG_88E ("Set BSSID under fw_state = 0x%08x\n" ,get_fwstate (pmlmepriv)); -if (check_fwstate (pmlmepriv, _FW_UNDER_SURVEY) == true) +if (check_fwstate (pmlmepriv, _FW_UNDER_SURVEY)) goto handle_tkip_countermeasure;else if (check_fwstate (pmlmepriv, _FW_UNDER_LINKING)) goto release_mlme_lock;@@ -171,7 +171,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid)RT_TRACE (_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_bssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n" ));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 {RT_TRACE (_module_rtl871x_ioctl_set_c_, _drv_info_, ("Set BSSID not the same bssid\n" ));@@ -180,12 +180,12 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid)rtw_disassoc_cmd (padapter,0 , true); -if (check_fwstate (pmlmepriv, _FW_LINKED) == true) +if (check_fwstate (pmlmepriv, _FW_LINKED))rtw_indicate_disconnect (padapter);rtw_free_assoc_resources (padapter); -if ((check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ) == true)) { +if ((check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ))) {_clr_fwstate_ (pmlmepriv,WIFI_ADHOC_MASTER_STATE );set_fwstate (pmlmepriv,WIFI_ADHOC_STATE ); }@@ -248,9 +248,9 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)spin_lock_bh (&pmlmepriv->lock);DBG_88E ("Set SSID under fw_state = 0x%08x\n" ,get_fwstate (pmlmepriv)); -if (check_fwstate (pmlmepriv, _FW_UNDER_SURVEY) == true) +if (check_fwstate (pmlmepriv, _FW_UNDER_SURVEY)) goto handle_tkip_countermeasure; -else if (check_fwstate (pmlmepriv, _FW_UNDER_LINKING) == true) +else if (check_fwstate (pmlmepriv, _FW_UNDER_LINKING)) goto release_mlme_lock;if (check_fwstate (pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE )) {@@ -268,12 +268,12 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)/* if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again */ rtw_disassoc_cmd (padapter,0 , true); -if (check_fwstate (pmlmepriv, _FW_LINKED) == true) +if (check_fwstate (pmlmepriv, _FW_LINKED))rtw_indicate_disconnect (padapter);rtw_free_assoc_resources (padapter); -if (check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ) == true) { +if (check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE )) {_clr_fwstate_ (pmlmepriv,WIFI_ADHOC_MASTER_STATE );set_fwstate (pmlmepriv,WIFI_ADHOC_STATE ); }@@ -290,12 +290,12 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)rtw_disassoc_cmd (padapter,0 , true); -if (check_fwstate (pmlmepriv, _FW_LINKED) == true) +if (check_fwstate (pmlmepriv, _FW_LINKED))rtw_indicate_disconnect (padapter);rtw_free_assoc_resources (padapter); -if (check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ) == true) { +if (check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE )) {_clr_fwstate_ (pmlmepriv,WIFI_ADHOC_MASTER_STATE );set_fwstate (pmlmepriv,WIFI_ADHOC_STATE ); }@@ -319,7 +319,7 @@ handle_tkip_countermeasure:memcpy (&pmlmepriv->assoc_ssid, ssid,sizeof (struct ndis_802_11_ssid )); pmlmepriv->assoc_by_bssid = false; -if (check_fwstate (pmlmepriv, _FW_UNDER_SURVEY) == true) +if (check_fwstate (pmlmepriv, _FW_UNDER_SURVEY)) pmlmepriv->to_join = true;else status =rtw_do_join (padapter);@@ -369,7 +369,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,rtw_free_assoc_resources (padapter);if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) { -if (check_fwstate (pmlmepriv, _FW_LINKED) == true) +if (check_fwstate (pmlmepriv, _FW_LINKED))rtw_indicate_disconnect (padapter);/* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */ }@@ -450,7 +450,7 @@ u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_s res = true;if (check_fwstate (pmlmepriv, - (_FW_UNDER_SURVEY|_FW_UNDER_LINKING)) == true) + (_FW_UNDER_SURVEY|_FW_UNDER_LINKING)))RT_TRACE (_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n###_FW_UNDER_SURVEY|_FW_UNDER_LINKING\n\n" ));else RT_TRACE (_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n###pmlmepriv->sitesurveyctrl.traffic_busy == true\n\n" ));Signature · 1 line
2.1.4
A message that is not in the archive (sent off-list or not yet received): CAO393ADgv9pagiMpKATAcSvec_4TONUmUutCZDOr_T4ujxGsRQ@mail.gmail.com
Re: [PATCH v3 3/3] Staging: rtl8188eu: Bool tests don't need comparisons
Quoted 66 lines · Shraddha Barke
On Sat, Sep 12, 2015 at 11:07 PM, Julia Lawall <[email protected]> wrote:
On Sat, 12 Sep 2015, Shraddha Barke wrote: > This patch removes comparisons to true/false values on bool variables. > > Changes in v3- > Fix made manually > > Signed-off-by: Shraddha Barke <[email protected]> > --- > drivers/staging/rtl8188eu/core/rtw_cmd.c | 12 +++++------ > drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 28 +++++++++++++------------- > 2 files changed, 20 insertions(+), 20 deletions(-) > > diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c > index 001a2f3..591ac5d 100644 > --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c > +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c > @@ -272,7 +272,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, > struct cmd_priv *pcmdpriv = &padapter->cmdpriv; > struct mlme_priv *pmlmepriv = &padapter->mlmepriv; > > - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) > + if (check_fwstate(pmlmepriv, _FW_LINKED)) > rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1); > > ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); > @@ -903,7 +903,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) > pmlmepriv = &(padapter->mlmepriv); > > #ifdef CONFIG_88EU_AP_MODE > - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) > + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) > expire_timeout_chk(padapter); > #endif > > @@ -920,13 +920,13 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type) > u8 mstatus; > > > - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || > - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) > + if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) || > + (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))) You don't need to keep the parentheses. julia
Quoted 2 lines
I don't see extra parentheses. Aren't all of them needed to improve readability?
You have basically ((foo(1,2,3)) || (foo(4,5,6)))
I don't think that is more readable than (foo(1,2,3) || foo(4,5,6))
Actually, the parentheses weren't really needed before, but they are even less useful now.
julia