Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1223720

[PATCH v4 1/3] Staging: rtl8723au: core: Bool tests don't need comparisons

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Shraddha Barke <shraddha.6596@gmail.com>
Newsgroups linux.kernel
Subject [PATCH v4 1/3] Staging: rtl8723au: core: Bool tests don't need comparisons
Date Sun, 13 Sep 2015 18:30:02 +0200
Message-ID <q8ika-4tk-7@gated-at.bofh.it> (permalink)
References <q8ika-4tk-3@gated-at.bofh.it>
X-Original-To Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jes Sorensen <Jes.Sorensen@redhat.com>, Julia Lawall <julia.lawall@lip6.fr>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DbqgadhObwtTO3cxO7w6T6AZhZxcwG3GDvQzM4vylp8=; b=YBzQPVaf4lsB8i69maqV0bGD4VaFYv8p62yYgDTxJQOGxNjg3zY9U0T4hhJsN331rI 2+q4g+9F+N+c+pq/U9RP+EOorQjSBGJREWqGla5xPDJ1S+Wonqq51HK1BjrEy4UqfCwO /HLPUNSsRqQbjBjJeg10jIppvvsKLMgenZD2yR13X0f8koJJ0MKqU/Yc36Uljjb3KFyf akctu6oc9jguUxB6L65bAMvbkJcjVOMPw6wPyEUGXQ7NnJTGpd5Ka4Ox5u8ZV4oRg29g 0PW/4pIfIm3pIKMNy/0iAf+WwNQmiwTGm27SUnyA12c2yEeSQ7Gdyb8X0WZrY/6FtEh+ m2kw==
X-Received by 10.66.159.197 with SMTP id xe5mr24412278pab.32.1442161657568; Sun, 13 Sep 2015 09:27:37 -0700 (PDT)
X-Mailer git-send-email 2.1.4
X-Cyberoam-Smtpxy-Version 1.0.6.3
X-Cyberoam-Av-Policy default
X-Ctch-Pver 0000001
X-Ctch-Spam Unknown
X-Ctch-Vod Unknown
X-Ctch-Refid str=0001.0A150204.55F5A3F8.0051,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0
X-Ctch-Score 0.000
X-Ctch-Scorecust 0.000
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 179
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, Shraddha Barke <shraddha.6596@gmail.com>
X-Original-Date Sun, 13 Sep 2015 21:57:20 +0530
X-Original-Message-ID <1442161641-7598-2-git-send-email-shraddha.6596@gmail.com>
X-Original-References <1442161641-7598-1-git-send-email-shraddha.6596@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1223720

Show key headers only | View raw


This patch removes comparisons to true/false values on bool variables.



Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
Changes in v4-
 No change

 drivers/staging/rtl8723au/core/rtw_ap.c       | 10 +++++-----
 drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 28 +++++++++++++--------------
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c
index b96e7b6..7f46b7a 100644
--- a/drivers/staging/rtl8723au/core/rtw_ap.c
+++ b/drivers/staging/rtl8723au/core/rtw_ap.c
@@ -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 !=
@@ -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,7 +1882,7 @@ 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);
diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
index be9a3d5..65ef4a4 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
@@ -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;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v4 1/3] Staging: rtl8723au: core: Bool tests don't need comparisons Shraddha Barke <shraddha.6596@gmail.com> - 2015-09-13 18:30 +0200
  Re: [PATCH v4 1/3] Staging: rtl8723au: core: Bool tests don't need comparisons Jes Sorensen <Jes.Sorensen@redhat.com> - 2015-09-14 15:00 +0200

csiph-web