From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C52C82F80 for ; Fri, 30 Apr 2021 13:00:05 +0000 (UTC) Received: from localhost (unknown [192.168.167.235]) by lucky1.263xmail.com (Postfix) with ESMTP id 1DEE7C82DC; Fri, 30 Apr 2021 20:56:58 +0800 (CST) X-MAIL-GRAY:0 X-MAIL-DELIVERY:1 X-ADDR-CHECKED:0 X-ANTISPAM-LEVEL:2 X-ABS-CHECKED:0 Received: from localhost.localdomain (unknown [124.126.19.250]) by smtp.263.net (postfix) whith ESMTP id P2752T140649378854656S1619787419291419_; Fri, 30 Apr 2021 20:56:59 +0800 (CST) X-IP-DOMAINF:1 X-UNIQUE-TAG: X-RL-SENDER:zhaoxiao@uniontech.com X-SENDER:zhaoxiao@uniontech.com X-LOGIN-NAME:zhaoxiao@uniontech.com X-FST-TO:gregkh@linuxfoundation.org X-RCPT-COUNT:9 X-SENDER-IP:124.126.19.250 X-ATTACHMENT-NUM:0 X-System-Flag:0 From: zhaoxiao To: gregkh@linuxfoundation.org, john.oldman@polehill.co.uk, eduard.vintila47@gmail.com Cc: will+git@drnd.me, dan.carpenter@oracle.com, mitaliborkar810@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, zhaoxiao Subject: [PATCH] staging: rtl8192e: replace comparison to NULL by bool Date: Fri, 30 Apr 2021 20:56:57 +0800 Message-Id: <20210430125657.18264-1-zhaoxiao@uniontech.com> X-Mailer: git-send-email 2.20.1 X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Fixed Comparison to NULL can be written as '!...' by replacing it with simpler form i.e boolean expression. This makes code more readable alternative. Reported by checkpatch. Signed-off-by: zhaoxiao --- drivers/staging/rtl8192e/rtl819x_HTProc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index 48d28c7d870b..3b8efaf9b88c 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -276,7 +276,7 @@ void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap, struct rt_hi_throughput *pHT = ieee->pHTInfo; struct ht_capab_ele *pCapELE = NULL; - if ((posHTCap == NULL) || (pHT == NULL)) { + if (!posHTCap || !pHT) { netdev_warn(ieee->dev, "%s(): posHTCap and pHTInfo are null\n", __func__); return; @@ -357,7 +357,7 @@ void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo, struct rt_hi_throughput *pHT = ieee->pHTInfo; struct ht_info_ele *pHTInfoEle = (struct ht_info_ele *)posHTInfo; - if ((posHTInfo == NULL) || (pHTInfoEle == NULL)) { + if (!posHTInfo || !pHTInfoEle) { netdev_warn(ieee->dev, "%s(): posHTInfo and pHTInfoEle are null\n", __func__); @@ -397,7 +397,7 @@ void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo, void HTConstructRT2RTAggElement(struct rtllib_device *ieee, u8 *posRT2RTAgg, u8 *len) { - if (posRT2RTAgg == NULL) { + if (!posRT2RTAgg) { netdev_warn(ieee->dev, "%s(): posRT2RTAgg is null\n", __func__); return; } @@ -420,7 +420,7 @@ static u8 HT_PickMCSRate(struct rtllib_device *ieee, u8 *pOperateMCS) { u8 i; - if (pOperateMCS == NULL) { + if (!pOperateMCS) { netdev_warn(ieee->dev, "%s(): pOperateMCS is null\n", __func__); return false; } @@ -453,7 +453,7 @@ u8 HTGetHighestMCSRate(struct rtllib_device *ieee, u8 *pMCSRateSet, u8 mcsRate = 0; u8 availableMcsRate[16]; - if (pMCSRateSet == NULL || pMCSFilter == NULL) { + if (!pMCSRateSet || !pMCSFilter) { netdev_warn(ieee->dev, "%s(): pMCSRateSet and pMCSFilter are null\n", __func__); -- 2.20.1