Commit 1e9a9c7c authored by Aditya Srivastava's avatar Aditya Srivastava Committed by Greg Kroah-Hartman

staging: rtl8192e: fix bool comparison in expressions

There are certain conditional expressions in rtl8192e, where a boolean
variable is compared with true/false, in forms such as (foo == true) or
(false != bar), which does not comply with checkpatch.pl (CHECK:
BOOL_COMPARISON), according to which boolean variables should be
themselves used in the condition, rather than comparing with true/false

E.g. in drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c,
"if (Type == true)" can be replaced with: "if (Type)"

Replace all such expressions with the bool variables appropriately
Signed-off-by: default avatarAditya Srivastava <yashsri421@gmail.com>
Link: https://lore.kernel.org/r/20201220194224.12835-1-yashsri421@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f31559af
...@@ -129,9 +129,9 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val) ...@@ -129,9 +129,9 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val)
RegRCR = rtl92e_readl(dev, RCR); RegRCR = rtl92e_readl(dev, RCR);
priv->ReceiveConfig = RegRCR; priv->ReceiveConfig = RegRCR;
if (Type == true) if (Type)
RegRCR |= (RCR_CBSSID); RegRCR |= (RCR_CBSSID);
else if (Type == false) else
RegRCR &= (~RCR_CBSSID); RegRCR &= (~RCR_CBSSID);
rtl92e_writel(dev, RCR, RegRCR); rtl92e_writel(dev, RCR, RegRCR);
......
...@@ -1389,7 +1389,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) ...@@ -1389,7 +1389,7 @@ static void _rtl92e_watchdog_wq_cb(void *data)
rtl92e_dm_watchdog(dev); rtl92e_dm_watchdog(dev);
if (rtllib_act_scanning(priv->rtllib, false) == false) { if (!rtllib_act_scanning(priv->rtllib, false)) {
if ((ieee->iw_mode == IW_MODE_INFRA) && (ieee->state == if ((ieee->iw_mode == IW_MODE_INFRA) && (ieee->state ==
RTLLIB_NOLINK) && RTLLIB_NOLINK) &&
(ieee->eRFPowerState == eRfOn) && !ieee->is_set_key && (ieee->eRFPowerState == eRfOn) && !ieee->is_set_key &&
...@@ -2471,7 +2471,7 @@ static int _rtl92e_pci_probe(struct pci_dev *pdev, ...@@ -2471,7 +2471,7 @@ static int _rtl92e_pci_probe(struct pci_dev *pdev,
priv->ops = ops; priv->ops = ops;
if (rtl92e_check_adapter(pdev, dev) == false) if (!rtl92e_check_adapter(pdev, dev))
goto err_unmap; goto err_unmap;
dev->irq = pdev->irq; dev->irq = pdev->irq;
......
...@@ -1765,7 +1765,7 @@ static void _rtl92e_dm_cts_to_self(struct net_device *dev) ...@@ -1765,7 +1765,7 @@ static void _rtl92e_dm_cts_to_self(struct net_device *dev)
unsigned long curTxOkCnt = 0; unsigned long curTxOkCnt = 0;
unsigned long curRxOkCnt = 0; unsigned long curRxOkCnt = 0;
if (priv->rtllib->bCTSToSelfEnable != true) { if (!priv->rtllib->bCTSToSelfEnable) {
pHTInfo->IOTAction &= ~HT_IOT_ACT_FORCED_CTS2SELF; pHTInfo->IOTAction &= ~HT_IOT_ACT_FORCED_CTS2SELF;
return; return;
} }
...@@ -2447,7 +2447,7 @@ static void _rtl92e_dm_dynamic_tx_power(struct net_device *dev) ...@@ -2447,7 +2447,7 @@ static void _rtl92e_dm_dynamic_tx_power(struct net_device *dev)
unsigned int txhipower_threshold = 0; unsigned int txhipower_threshold = 0;
unsigned int txlowpower_threshold = 0; unsigned int txlowpower_threshold = 0;
if (priv->rtllib->bdynamic_txpower_enable != true) { if (!priv->rtllib->bdynamic_txpower_enable) {
priv->bDynamicTxHighPower = false; priv->bDynamicTxHighPower = false;
priv->bDynamicTxLowPower = false; priv->bDynamicTxLowPower = false;
return; return;
......
...@@ -924,7 +924,7 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee, ...@@ -924,7 +924,7 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
sc = le16_to_cpu(hdr->seq_ctl); sc = le16_to_cpu(hdr->seq_ctl);
frag = WLAN_GET_SEQ_FRAG(sc); frag = WLAN_GET_SEQ_FRAG(sc);
if ((ieee->pHTInfo->bCurRxReorderEnable == false) || if (!ieee->pHTInfo->bCurRxReorderEnable ||
!ieee->current_network.qos_data.active || !ieee->current_network.qos_data.active ||
!IsDataFrame(skb->data) || !IsDataFrame(skb->data) ||
IsLegacyDataFrame(skb->data)) { IsLegacyDataFrame(skb->data)) {
...@@ -1442,8 +1442,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, ...@@ -1442,8 +1442,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
} }
/* Indicate packets to upper layer or Rx Reorder */ /* Indicate packets to upper layer or Rx Reorder */
if (ieee->pHTInfo->bCurRxReorderEnable == false || pTS == NULL || if (!ieee->pHTInfo->bCurRxReorderEnable || pTS == NULL || bToOtherSTA)
bToOtherSTA)
rtllib_rx_indicate_pkt_legacy(ieee, rx_stats, rxb, dst, src); rtllib_rx_indicate_pkt_legacy(ieee, rx_stats, rxb, dst, src);
else else
RxReorderIndicatePacket(ieee, rxb, pTS, SeqNum); RxReorderIndicatePacket(ieee, rxb, pTS, SeqNum);
......
...@@ -297,7 +297,7 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee, ...@@ -297,7 +297,7 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee,
netdev_info(ieee->dev, "%s: can't get TS\n", __func__); netdev_info(ieee->dev, "%s: can't get TS\n", __func__);
return; return;
} }
if (pTxTs->TxAdmittedBARecord.bValid == false) { if (!pTxTs->TxAdmittedBARecord.bValid) {
if (ieee->wpa_ie_len && (ieee->pairwise_key_type == if (ieee->wpa_ie_len && (ieee->pairwise_key_type ==
KEY_TYPE_NA)) { KEY_TYPE_NA)) {
; ;
...@@ -307,7 +307,7 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee, ...@@ -307,7 +307,7 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee,
TsStartAddBaProcess(ieee, pTxTs); TsStartAddBaProcess(ieee, pTxTs);
} }
goto FORCED_AGG_SETTING; goto FORCED_AGG_SETTING;
} else if (pTxTs->bUsingBa == false) { } else if (!pTxTs->bUsingBa) {
if (SN_LESS(pTxTs->TxAdmittedBARecord.BaStartSeqCtrl.field.SeqNum, if (SN_LESS(pTxTs->TxAdmittedBARecord.BaStartSeqCtrl.field.SeqNum,
(pTxTs->TxCurSeq+1)%4096)) (pTxTs->TxCurSeq+1)%4096))
pTxTs->bUsingBa = true; pTxTs->bUsingBa = true;
...@@ -365,9 +365,9 @@ static void rtllib_query_HTCapShortGI(struct rtllib_device *ieee, ...@@ -365,9 +365,9 @@ static void rtllib_query_HTCapShortGI(struct rtllib_device *ieee,
return; return;
} }
if ((pHTInfo->bCurBW40MHz == true) && pHTInfo->bCurShortGI40MHz) if (pHTInfo->bCurBW40MHz && pHTInfo->bCurShortGI40MHz)
tcb_desc->bUseShortGI = true; tcb_desc->bUseShortGI = true;
else if ((pHTInfo->bCurBW40MHz == false) && pHTInfo->bCurShortGI20MHz) else if (!pHTInfo->bCurBW40MHz && pHTInfo->bCurShortGI20MHz)
tcb_desc->bUseShortGI = true; tcb_desc->bUseShortGI = true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment