From: SF Markus Elfring <elfring@users.sourceforge.net>
To: ath9k-devel@qca.qualcomm.com, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, Kalle Valo <kvalo@codeaurora.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 3/3] ath9k: Adjust a null pointer check in three functions
Date: Tue, 9 May 2017 09:29:04 +0200 [thread overview]
Message-ID: <6c3d87e0-d758-6f9b-4b1f-156d890b788d@users.sourceforge.net> (raw)
In-Reply-To: <03575993-754d-924c-9736-2a8d19e98fa5@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 8 May 2017 22:17:13 +0200
The script "checkpatch.pl" pointed information out like the following.
Comparison to NULL could be written "!buf"
Thus adjust this expression.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/wireless/ath/ath9k/debug.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 0d215598193c..5f2c1d8e8e70 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -161,7 +161,7 @@ static ssize_t read_file_ani(struct file *file, char __user *user_buf,
};
buf = kzalloc(size, GFP_KERNEL);
- if (buf == NULL)
+ if (!buf)
return -ENOMEM;
len += scnprintf(buf + len, size - len, "%15s: %s\n", "ANI",
@@ -315,7 +315,7 @@ static ssize_t read_file_antenna_diversity(struct file *file,
};
buf = kzalloc(size, GFP_KERNEL);
- if (buf == NULL)
+ if (!buf)
return -ENOMEM;
if (!(pCap->hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB)) {
@@ -1008,7 +1008,7 @@ static ssize_t read_file_btcoex(struct file *file, char __user *user_buf,
size_t retval;
buf = kzalloc(size, GFP_KERNEL);
- if (buf == NULL)
+ if (!buf)
return -ENOMEM;
if (!sc->sc_ah->common.btcoex_enabled) {
--
2.12.2
prev parent reply other threads:[~2017-05-09 7:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-09 7:25 [PATCH 0/3] ath9k: Fine-tuning for some function implementations SF Markus Elfring
2017-05-09 7:26 ` [PATCH 1/3] ath9k: Reduce function calls for sequence output in read_file_dma() SF Markus Elfring
2017-05-09 7:28 ` [PATCH 2/3] ath9k: Replace four seq_printf() calls by seq_putc() SF Markus Elfring
2017-05-09 7:29 ` SF Markus Elfring [this message]
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=6c3d87e0-d758-6f9b-4b1f-156d890b788d@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=ath9k-devel@qca.qualcomm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).