[PATCH 3/4] Staging: rtl8712: Bool tests don't need comparisons
From: Shraddha Barke
Date: Sat Sep 12 2015 - 01:50:39 EST
This patch removes comparisons to true/false values on bool variables.
Fix made using Coccinelle
Signed-off-by: Shraddha Barke <shraddha.6596@xxxxxxxxx>
---
drivers/staging/rtl8712/rtl871x_ioctl_set.c | 4 ++++------
drivers/staging/rtl8712/rtl871x_mlme.c | 3 +--
drivers/staging/rtl8712/rtl871x_recv.c | 4 ++--
drivers/staging/rtl8712/rtl871x_xmit.c | 2 +-
drivers/staging/rtl8712/usb_intf.c | 2 +-
5 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_set.c b/drivers/staging/rtl8712/rtl871x_ioctl_set.c
index 22262b3..528ef7a 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_set.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_set.c
@@ -149,7 +149,7 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid)
* WIFI_ADHOC_MASTER_STATE */
} else {
r8712_disassoc_cmd(padapter);
- if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
+ if (check_fwstate(pmlmepriv, _FW_LINKED))
r8712_ind_disconnect(padapter);
r8712_free_assoc_resources(padapter);
if ((check_fwstate(pmlmepriv,
@@ -213,7 +212,7 @@ void r8712_set_802_11_ssid(struct _adapter *padapter,
}
} else {
r8712_disassoc_cmd(padapter);
- if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
+ if (check_fwstate(pmlmepriv, _FW_LINKED))
r8712_ind_disconnect(padapter);
r8712_free_assoc_resources(padapter);
if (check_fwstate(pmlmepriv,
diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c
index fc5dbea..a7d8d7f 100644
--- a/drivers/staging/rtl8712/rtl871x_mlme.c
+++ b/drivers/staging/rtl8712/rtl871x_mlme.c
@@ -897,8 +897,7 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf)
update_ht_cap(adapter, cur_network->network.IEs,
cur_network->network.IELength);
/*indicate connect*/
- if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)
- == true)
+ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
r8712_indicate_connect(adapter);
del_timer(&pmlmepriv->assoc_timer);
} else
diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c
index 046a46c..10b1ad5 100644
--- a/drivers/staging/rtl8712/rtl871x_recv.c
+++ b/drivers/staging/rtl8712/rtl871x_recv.c
@@ -198,7 +198,7 @@ sint r8712_recvframe_chkmic(struct _adapter *adapter,
bmic_err = true;
}
if (bmic_err == true) {
- if (prxattrib->bdecrypted == true)
+ if (prxattrib->bdecrypted)
r8712_handle_tkip_mic_err(adapter,
(u8)IS_MCAST(prxattrib->ra));
res = _FAIL;
@@ -369,7 +369,7 @@ static sint sta2sta_data_frame(struct _adapter *adapter,
else
*psta = r8712_get_stainfo(pstapriv, sta_addr); /* get ap_info */
if (*psta == NULL) {
- if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true)
+ if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
adapter->mppriv.rx_pktloss++;
return _FAIL;
}
diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c b/drivers/staging/rtl8712/rtl871x_xmit.c
index 2e4fa88..7ceeab3 100644
--- a/drivers/staging/rtl8712/rtl871x_xmit.c
+++ b/drivers/staging/rtl8712/rtl871x_xmit.c
@@ -337,7 +337,7 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
pattrib->bswenc = false;
/* if in MP_STATE, update pkt_attrib from mp_txcmd, and overwrite
* some settings above.*/
- if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true)
+ if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
pattrib->priority = (txdesc.txdw1 >> QSEL_SHT) & 0x1f;
return _SUCCESS;
}
diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
index f8b5b33..7e6a29c 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -611,7 +611,7 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
release_firmware(padapter->fw);
/* never exit with a firmware callback pending */
wait_for_completion(&padapter->rtl8712_fw_ready);
- if (drvpriv.drv_registered == true)
+ if (drvpriv.drv_registered)
padapter->bSurpriseRemoved = true;
unregister_netdev(pnetdev); /* will call netdev_close() */
flush_scheduled_work();
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/