[v2,1/4] Staging: rtl8723au: Bool tests don't need comparisons
diff mbox series

Message ID 1442055931-6056-1-git-send-email-shraddha.6596@gmail.com
State New, archived
Headers show
Series
  • [v2,1/4] Staging: rtl8723au: Bool tests don't need comparisons
Related show

Commit Message

Shraddha Barke Sept. 12, 2015, 11:05 a.m. UTC
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(-)

Patch
diff mbox series

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);