From: "Simon Sandström" <simon@nikanor.nu>
To: gregkh@linuxfoundation.org
Cc: gneukum1@gmail.com, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org,
"Simon Sandström" <simon@nikanor.nu>
Subject: [PATCH 1/3] staging: kpc2000: simplify comparison to NULL in kpc2000_spi.c
Date: Thu, 4 Jul 2019 08:08:09 +0200 [thread overview]
Message-ID: <20190704060811.10330-2-simon@nikanor.nu> (raw)
In-Reply-To: <20190704060811.10330-1-simon@nikanor.nu>
Fixes checkpatch warning "Comparison to NULL could be written [...]".
Signed-off-by: Simon Sandström <simon@nikanor.nu>
---
drivers/staging/kpc2000/kpc2000_spi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c
index 009dec2f4641..35ac1d7070b3 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -436,7 +436,7 @@ kp_spi_probe(struct platform_device *pldev)
}
master = spi_alloc_master(&pldev->dev, sizeof(struct kp_spi));
- if (master == NULL) {
+ if (!master) {
dev_err(&pldev->dev, "%s: master allocation failed\n",
__func__);
return -ENOMEM;
@@ -460,7 +460,7 @@ kp_spi_probe(struct platform_device *pldev)
master->bus_num = pldev->id;
r = platform_get_resource(pldev, IORESOURCE_MEM, 0);
- if (r == NULL) {
+ if (!r) {
dev_err(&pldev->dev, "%s: Unable to get platform resources\n",
__func__);
status = -ENODEV;
--
2.20.1
next prev parent reply other threads:[~2019-07-04 6:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-04 6:08 [PATCH 0/3] Simplify NULL comparisons in staging/kpc2000 Simon Sandström
2019-07-04 6:08 ` Simon Sandström [this message]
2019-07-04 6:08 ` [PATCH 2/3] staging: kpc2000: simplify comparison to NULL in dma.c Simon Sandström
2019-07-04 6:08 ` [PATCH 3/3] staging: kpc2000: simplify comparison to NULL in fileops.c Simon Sandström
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=20190704060811.10330-2-simon@nikanor.nu \
--to=simon@nikanor.nu \
--cc=devel@driverdev.osuosl.org \
--cc=gneukum1@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®