From: John Whitmore <johnfwhitmore@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org, colin.king@canonical.com,
tglx@linutronix.de, kstewart@linuxfoundation.org,
devel@driverdev.osuosl.org,
John Whitmore <johnfwhitmore@gmail.com>
Subject: [PATCH v6 7/8] staging: rtl8192e: Optimise Comparison to NULL tests - Coding Style
Date: Wed, 6 Jun 2018 12:40:02 +0100 [thread overview]
Message-ID: <20180606114003.22654-8-johnfwhitmore@gmail.com> (raw)
In-Reply-To: <20180606114003.22654-1-johnfwhitmore@gmail.com>
Change comparison to NULL to better adhere to coding standard.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 7ea516609d4c..9cca4a8f1cf5 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -520,7 +520,7 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
PHT_CAPABILITY_ELE pCapELE = NULL;
//u8 bIsDeclareMCS13;
- if ((posHTCap == NULL) || (pHT == NULL)) {
+ if (!posHTCap || !pHT) {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "posHTCap or pHTInfo can't be null in HTConstructCapabilityElement()\n");
return;
}
@@ -624,7 +624,7 @@ void HTConstructInfoElement(struct ieee80211_device *ieee, u8 *posHTInfo, u8 *le
PRT_HIGH_THROUGHPUT pHT = ieee->pHTInfo;
PHT_INFORMATION_ELE pHTInfoEle = (PHT_INFORMATION_ELE)posHTInfo;
- if ((posHTInfo == NULL) || (pHTInfoEle == NULL)) {
+ if (!posHTInfo || !pHTInfoEle) {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "posHTInfo or pHTInfoEle can't be null in HTConstructInfoElement()\n");
return;
}
@@ -687,7 +687,7 @@ void HTConstructInfoElement(struct ieee80211_device *ieee, u8 *posHTInfo, u8 *le
* *****************************************************************************************************************/
void HTConstructRT2RTAggElement(struct ieee80211_device *ieee, u8 *posRT2RTAgg, u8 *len)
{
- if (posRT2RTAgg == NULL) {
+ if (!posRT2RTAgg) {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "posRT2RTAgg can't be null in HTConstructRT2RTAggElement()\n");
return;
}
@@ -737,7 +737,7 @@ static u8 HT_PickMCSRate(struct ieee80211_device *ieee, u8 *pOperateMCS)
{
u8 i;
- if (pOperateMCS == NULL) {
+ if (!pOperateMCS) {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "pOperateMCS can't be null in HT_PickMCSRate()\n");
return false;
}
@@ -799,7 +799,7 @@ u8 HTGetHighestMCSRate(struct ieee80211_device *ieee, u8 *pMCSRateSet, u8 *pMCSF
u8 mcsRate = 0;
u8 availableMcsRate[16];
- if (pMCSRateSet == NULL || pMCSFilter == NULL) {
+ if (!pMCSRateSet || !pMCSFilter) {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "pMCSRateSet or pMCSFilter can't be null in HTGetHighestMCSRate()\n");
return false;
}
--
2.17.0
next prev parent reply other threads:[~2018-06-06 11:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-06 11:39 staging: rtl8192e: Series of coding style changes John Whitmore
2018-06-06 11:39 ` [PATCH v6 1/8] staging: rtl8192e: Add and remove blank lines - Coding style John Whitmore
2018-06-06 11:39 ` [PATCH v6 2/8] staging: rtl8192e: Addition of prefered spacing " John Whitmore
2018-06-06 11:39 ` [PATCH v6 3/8] staging: rtl8192e: Remove unnecessary return statements " John Whitmore
2018-06-06 11:39 ` [PATCH v6 4/8] staging: rtl8192e: Correct alignment of if statements - Coding Style John Whitmore
2018-06-06 11:40 ` [PATCH v6 5/8] staging: rtl8192e: Remove unrequired space at start of line " John Whitmore
2018-06-06 11:40 ` [PATCH v6 6/8] staging: rtl8192e: Correct declaration of HTResetIOTSetting " John Whitmore
2018-06-06 11:40 ` John Whitmore [this message]
2018-06-06 11:40 ` [PATCH v6 8/8] staging: rtl8192e: remove unnecessary parentheses " John Whitmore
2018-06-08 12:18 ` Dan Carpenter
2018-06-08 13:01 ` John Whitmore
2018-06-06 12:19 ` staging: rtl8192e: Series of coding style changes Justin Skists
2018-06-15 17:42 ` John Whitmore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180606114003.22654-8-johnfwhitmore@gmail.com \
--to=johnfwhitmore@gmail.com \
--cc=colin.king@canonical.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=kstewart@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox