linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shraddha Barke <shraddha.6596@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jes Sorensen <Jes.Sorensen@redhat.com>,
	Julia Lawall <julia.lawall@lip6.fr>,
	linux-kernel@vger.kernel.org
Cc: Shraddha Barke <shraddha.6596@gmail.com>
Subject: [PATCH v2 1/4] Staging: rtl8723au: Bool tests don't need comparisons
Date: Sat, 12 Sep 2015 16:35:28 +0530	[thread overview]
Message-ID: <1442055931-6056-1-git-send-email-shraddha.6596@gmail.com> (raw)

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

Change in v2-
 Consider cases with false

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
 drivers/staging/rtl8723au/core/rtw_ap.c             | 4 ++--
 drivers/staging/rtl8723au/core/rtw_mlme_ext.c       | 4 ++--
 drivers/staging/rtl8723au/core/rtw_wlan_util.c      | 2 +-
 drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 6 +++---
 drivers/staging/rtl8723au/hal/rtl8723au_recv.c      | 2 +-
 drivers/staging/rtl8723au/hal/usb_halinit.c         | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c
index 65b209a..bd1a306 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 */
diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
index be9a3d5..9cab19f 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
@@ -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)
diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
index 3c1315fc..208b24d 100644
--- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
@@ -231,7 +231,7 @@ static unsigned int ratetbl2rateset(struct rtw_adapter *padapter,
 		default:
 			rate = ratetbl_val_2wifirate(rate);
 
-			if (is_basicrate(padapter, rate) == true)
+			if (is_basicrate(padapter, rate))
 				rate |= IEEE80211_BASIC_RATE_MASK;
 
 			rateset[len] = rate;
diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
index cf15f80..503231c 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
@@ -5192,7 +5192,7 @@ static void btdm_NotifyFwScan(struct rtw_adapter *padapter, u8 scanType)
 {
 	u8 H2C_Parameter[1] = {0};
 
-	if (scanType == true)
+	if (scanType)
 		H2C_Parameter[0] = 0x1;
 
 	RTPRINT(FBT, BT_TRACE, ("[BTCoex], Notify FW for wifi scan, write 0x3b = 0x%02x\n",
@@ -9141,7 +9141,7 @@ u8 BTDM_IsWifiConnectionExist(struct rtw_adapter *padapter)
 	if (BTHCI_HsConnectionEstablished(padapter))
 		bRet = true;
 
-	if (check_fwstate(&padapter->mlmepriv, WIFI_ASOC_STATE) == true)
+	if (check_fwstate(&padapter->mlmepriv, WIFI_ASOC_STATE))
 		bRet = true;
 
 	return bRet;
@@ -9945,7 +9945,7 @@ void BTDM_CheckBTIdleChange1Ant(struct rtw_adapter *padapter)
 	}
 	if (!pBtMgnt->ExtConfig.bBTBusy) {
 		RTPRINT(FBT, BT_TRACE, ("[DM][BT], BT is idle or disable\n"));
-		if (check_fwstate(&padapter->mlmepriv, WIFI_UNDER_LINKING|WIFI_SITE_MONITOR) == true)
+		if (check_fwstate(&padapter->mlmepriv, WIFI_UNDER_LINKING | WIFI_SITE_MONITOR))
 			BTDM_SetAntenna(padapter, BTDM_ANT_WIFI);
 	}
 }
diff --git a/drivers/staging/rtl8723au/hal/rtl8723au_recv.c b/drivers/staging/rtl8723au/hal/rtl8723au_recv.c
index 0fec84b..7acd8ae 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723au_recv.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723au_recv.c
@@ -231,7 +231,7 @@ void update_recvframe_phyinfo(struct recv_frame *precvframe,
 
 	pkt_info.StationID = 0xFF;
 	if (pkt_info.bPacketBeacon) {
-		if (check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE) == true)
+		if (check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE))
 			sa = padapter->mlmepriv.cur_network.network.MacAddress;
 		/* to do Ad-hoc */
 	} else {
diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c b/drivers/staging/rtl8723au/hal/usb_halinit.c
index 9926b07..f2d3f54 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -1256,7 +1256,7 @@ void rtl8723a_update_ramask(struct rtw_adapter *padapter,
 	arg = mac_id & 0x1f;/* MACID */
 	arg |= BIT(7);
 
-	if (shortGIrate == true)
+	if (shortGIrate)
 		arg |= BIT(5);
 
 	DBG_8723A("update raid entry, mask = 0x%x, arg = 0x%x\n", mask, arg);
-- 
2.1.4


             reply	other threads:[~2015-09-12 11:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-12 11:05 Shraddha Barke [this message]
2015-09-12 11:05 ` [PATCH v2 2/4] Staging: vt6656: Bool tests don't need comparisons Shraddha Barke
2015-09-12 11:05 ` [PATCH v2 3/4] Staging: rtl8712: " Shraddha Barke
2015-09-12 11:50   ` Sudip Mukherjee
2015-09-12 11:05 ` [PATCH v2 4/4] Staging: rtl8188eu: " Shraddha Barke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1442055931-6056-1-git-send-email-shraddha.6596@gmail.com \
    --to=shraddha.6596@gmail.com \
    --cc=Jes.Sorensen@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).