From: Peng Li <lipeng321@huawei.com>
To: <davem@davemloft.net>, <kuba@kernel.org>, <xie.he.0141@gmail.com>,
<ms@dev.tdt.de>, <willemb@google.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<huangguangbin2@huawei.com>
Subject: [PATCH net-next 2/3] net: c101: replace comparison to NULL with "!card"
Date: Sat, 19 Jun 2021 15:28:37 +0800 [thread overview]
Message-ID: <1624087718-26595-3-git-send-email-lipeng321@huawei.com> (raw)
In-Reply-To: <1624087718-26595-1-git-send-email-lipeng321@huawei.com>
According to the chackpatch.pl, comparison to NULL could
be written "!card".
Signed-off-by: Peng Li <lipeng321@huawei.com>
---
drivers/net/wan/c101.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c
index 94b852f..f33192e 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -307,7 +307,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
}
card = kzalloc(sizeof(card_t), GFP_KERNEL);
- if (card == NULL)
+ if (!card)
return -ENOBUFS;
card->dev = alloc_hdlcdev(card);
@@ -381,7 +381,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
static int __init c101_init(void)
{
- if (hw == NULL) {
+ if (!hw) {
#ifdef MODULE
pr_info("no card initialized\n");
#endif
--
2.8.1
next prev parent reply other threads:[~2021-06-19 7:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-19 7:28 [PATCH net-next 0/3] net: c101: clean up some code style issues Peng Li
2021-06-19 7:28 ` [PATCH net-next 1/3] net: c101: add blank line after declarations Peng Li
2021-06-19 7:28 ` Peng Li [this message]
2021-06-19 7:28 ` [PATCH net-next 3/3] net: c101: remove redundant spaces Peng Li
2021-06-21 19:50 ` [PATCH net-next 0/3] net: c101: clean up some code style issues patchwork-bot+netdevbpf
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=1624087718-26595-3-git-send-email-lipeng321@huawei.com \
--to=lipeng321@huawei.com \
--cc=davem@davemloft.net \
--cc=huangguangbin2@huawei.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ms@dev.tdt.de \
--cc=netdev@vger.kernel.org \
--cc=willemb@google.com \
--cc=xie.he.0141@gmail.com \
/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).