Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1157405pxu; Thu, 17 Dec 2020 03:43:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJy6Ob6rB0+RWC+fMsWhkvu/j9PDJAdy7L7ZxKqfgibM+ypNPoyoSn5/30gd2/Ah/2+uiqlu X-Received: by 2002:aa7:cd15:: with SMTP id b21mr38518507edw.114.1608205415028; Thu, 17 Dec 2020 03:43:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608205415; cv=none; d=google.com; s=arc-20160816; b=KnW+g0s1Sn8V8M1GNyJAI7OJy8VvrMXX539bv3rIsqQ8JED/bUvz6CgnTkiXAgxVUU kqCsbSBYQK8z9e9U+IPXSAENiaIPvsGo3IRBe6uC6I7sf4LU0OKya0MU/0SLAlQiOy5/ RG6HIZ/Z7oM7aORnZpQNNFmSUDNgPDrkrk1pvu941krz5Tj8ZhwgTUrJkgyyn8kK7/4l pql2B39zqj9a8wZyo4L/eNZIHW4XENTHbiK0oRuVeUrmwunwWArBw6bt9WsdaDsZZGEG IRqqa4pjmfDMzXwBO0wGEpSxI7guCzmr0a11Jhyl3+Tmb2HfpJan4158Xbv7vMQsY9k6 GIrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=iwQofkBQgw3cgjabXt5hlRwi6VP4h40UXirWvwqnPHo=; b=hJ90WinuDDzfE3lsF7Y6lghtaUiytZLYRqkryvR9h7SKk1h0IgK7m7XBA80K3Brpgk N3YykOYafqKdVFTZ/vmUttQjLTSYXrc7zLDrsCzg/OKOYVw7yaJB/+b0plxQg4sXkixt QNMNJxNiSvEXOhLRS8kseEB0b+cH0oo5hI+o1Pq6P39SFBxpDoprDu9JN4N9UYE8CFV4 cZWXg+zw/ugHG4RkzZfcdjnDl0D6NaDskru4eeCpIyN2mWjPSYB/LHfETXVhdlY/NOFn muMCfAUuMCwVFiKQYcp3i+h4C92t/KWC1lHbSx97P4HrFTRMhcX1TTch1vWa8MuvGVbh neRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BDiS5DiT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si4956342edx.584.2020.12.17.03.43.12; Thu, 17 Dec 2020 03:43:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BDiS5DiT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727298AbgLQLm5 (ORCPT + 99 others); Thu, 17 Dec 2020 06:42:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727160AbgLQLm4 (ORCPT ); Thu, 17 Dec 2020 06:42:56 -0500 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85E3CC061794 for ; Thu, 17 Dec 2020 03:42:16 -0800 (PST) Received: by mail-pg1-x52f.google.com with SMTP id e2so20138554pgi.5 for ; Thu, 17 Dec 2020 03:42:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=iwQofkBQgw3cgjabXt5hlRwi6VP4h40UXirWvwqnPHo=; b=BDiS5DiTgIjGS1g3mPNIeyCNxm/HfEftIQB79tO0WJ95wfDH9LtEHbzFPk6YnWlysV 1RIYnhTG6k4e+QEwqu2HywpkOKCxIJCcq96hslKrqx2vG8u1VwGJd56HFVNfVVgBW/dc QjmS5NpRc7v40TOnk9xpIDEO5bcNn1vOwKQ6YUfxAuufqjEBwqRaL9s/DtmbBVG93gRC jz0r/3odyFJZcmhIoUAFrDlBczenl+Qi/7Mx9F2eSu/KjxlaLMpevkwh0BdmQnhPwjnc WzBhYWHHQyzXgfvcuacLa03XTe/1yeGRZXf9MV2hPwhnnAE4jQ4RRvRJ6gIylnEn/Wke 9a7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iwQofkBQgw3cgjabXt5hlRwi6VP4h40UXirWvwqnPHo=; b=PKnNCDFEHnnYPwYiK8kxb6KqiYUKOpPijFY4rSaJOr35KhJDnEKPhnYbXxR8BeUpkb 0UHgh6vRTEelW/aGJxDWM8/FGTY+txTsvkh+EgOh9WKVVIpVgkdpyVqdq1QCDEMUfDFi UQNcPwSJzUGyWaJV6aTIAycZF8MLDJhrsTOFvrVDqocvMqgSCxtzlAbn4oCHwwx+z/AO rWonVzxqnWo5UQcsX9sFgFQe+MJruAHxWhURAo43K0SgI7H2MXD0nnSZCMY1kdJeJdaH XLkePW04/9snsW5PgQIUebWGN28ItC0Y7TaZzDE/urawL/cfVo880BqtPSDt7Zg0+q+r NroA== X-Gm-Message-State: AOAM532pnKt1OrDT1R65NA+RhOpb4SNB4+xmbGfPvLy+Hrc4HOvJk4iV zCzTtHYI4Pqn7elaY89Rzp4= X-Received: by 2002:a63:1626:: with SMTP id w38mr6072860pgl.278.1608205335820; Thu, 17 Dec 2020 03:42:15 -0800 (PST) Received: from localhost.localdomain ([2402:3a80:403:493:5d38:be:6298:62ae]) by smtp.googlemail.com with ESMTPSA id j12sm5208765pjd.8.2020.12.17.03.42.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 03:42:15 -0800 (PST) From: Aditya Srivastava To: gregkh@linuxfoundation.org Cc: yashsri421@gmail.com, lukas.bulwahn@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: rtl8192e: fix bool comparison in expressions Date: Thu, 17 Dec 2020 17:12:04 +0530 Message-Id: <20201217114204.12029-1-yashsri421@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Aditya Srivastava --- - the changes made are compile tested - the patch applies perfectly over next-20201204 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 4 ++-- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 4 ++-- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 4 ++-- drivers/staging/rtl8192e/rtllib_rx.c | 4 ++-- drivers/staging/rtl8192e/rtllib_tx.c | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index 9f869fb3eaa8..c4a3fc79fb40 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -129,9 +129,9 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val) RegRCR = rtl92e_readl(dev, RCR); priv->ReceiveConfig = RegRCR; - if (Type == true) + if (Type) RegRCR |= (RCR_CBSSID); - else if (Type == false) + else if (!Type) RegRCR &= (~RCR_CBSSID); rtl92e_writel(dev, RCR, RegRCR); diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 663675efcfe4..9078fadd65f9 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -1389,7 +1389,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) 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 == RTLLIB_NOLINK) && (ieee->eRFPowerState == eRfOn) && !ieee->is_set_key && @@ -2471,7 +2471,7 @@ static int _rtl92e_pci_probe(struct pci_dev *pdev, priv->ops = ops; - if (rtl92e_check_adapter(pdev, dev) == false) + if (!rtl92e_check_adapter(pdev, dev)) goto err_unmap; dev->irq = pdev->irq; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index 462835684e8b..e340be3ebb97 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -1765,7 +1765,7 @@ static void _rtl92e_dm_cts_to_self(struct net_device *dev) unsigned long curTxOkCnt = 0; unsigned long curRxOkCnt = 0; - if (priv->rtllib->bCTSToSelfEnable != true) { + if (!priv->rtllib->bCTSToSelfEnable) { pHTInfo->IOTAction &= ~HT_IOT_ACT_FORCED_CTS2SELF; return; } @@ -2447,7 +2447,7 @@ static void _rtl92e_dm_dynamic_tx_power(struct net_device *dev) unsigned int txhipower_threshold = 0; unsigned int txlowpower_threshold = 0; - if (priv->rtllib->bdynamic_txpower_enable != true) { + if (!priv->rtllib->bdynamic_txpower_enable) { priv->bDynamicTxHighPower = false; priv->bDynamicTxLowPower = false; return; diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index d31b5e1c8df4..217557ac8d80 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -924,7 +924,7 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee, sc = le16_to_cpu(hdr->seq_ctl); frag = WLAN_GET_SEQ_FRAG(sc); - if ((ieee->pHTInfo->bCurRxReorderEnable == false) || + if ((!ieee->pHTInfo->bCurRxReorderEnable) || !ieee->current_network.qos_data.active || !IsDataFrame(skb->data) || IsLegacyDataFrame(skb->data)) { @@ -1442,7 +1442,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, } /* Indicate packets to upper layer or Rx Reorder */ - if (ieee->pHTInfo->bCurRxReorderEnable == false || pTS == NULL || + if (!ieee->pHTInfo->bCurRxReorderEnable || pTS == NULL || bToOtherSTA) rtllib_rx_indicate_pkt_legacy(ieee, rx_stats, rxb, dst, src); else diff --git a/drivers/staging/rtl8192e/rtllib_tx.c b/drivers/staging/rtl8192e/rtllib_tx.c index e0d79daca24a..8add17752eed 100644 --- a/drivers/staging/rtl8192e/rtllib_tx.c +++ b/drivers/staging/rtl8192e/rtllib_tx.c @@ -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__); return; } - if (pTxTs->TxAdmittedBARecord.bValid == false) { + if (!pTxTs->TxAdmittedBARecord.bValid) { if (ieee->wpa_ie_len && (ieee->pairwise_key_type == KEY_TYPE_NA)) { ; @@ -307,7 +307,7 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee, TsStartAddBaProcess(ieee, pTxTs); } goto FORCED_AGG_SETTING; - } else if (pTxTs->bUsingBa == false) { + } else if (!pTxTs->bUsingBa) { if (SN_LESS(pTxTs->TxAdmittedBARecord.BaStartSeqCtrl.field.SeqNum, (pTxTs->TxCurSeq+1)%4096)) pTxTs->bUsingBa = true; @@ -365,9 +365,9 @@ static void rtllib_query_HTCapShortGI(struct rtllib_device *ieee, return; } - if ((pHTInfo->bCurBW40MHz == true) && pHTInfo->bCurShortGI40MHz) + if (pHTInfo->bCurBW40MHz && pHTInfo->bCurShortGI40MHz) tcb_desc->bUseShortGI = true; - else if ((pHTInfo->bCurBW40MHz == false) && pHTInfo->bCurShortGI20MHz) + else if (!pHTInfo->bCurBW40MHz && pHTInfo->bCurShortGI20MHz) tcb_desc->bUseShortGI = true; } -- 2.17.1