From: Shraddha Barke <shraddha.6596@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alan Cox <alan@linux.intel.com>,
linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
Jin Qian <jinqian@google.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
Shraddha Barke <shraddha.6596@gmail.com>
Subject: [PATCH v2 2/2] Staging: goldfish: Remove explicit NULL comparison
Date: Thu, 7 Jan 2016 23:08:38 +0530 [thread overview]
Message-ID: <1452188318-8184-3-git-send-email-shraddha.6596@gmail.com> (raw)
In-Reply-To: <1452188318-8184-1-git-send-email-shraddha.6596@gmail.com>
Remove explicit NULL comparison and write it in its simpler form.
Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
Changes in v2-
No change.Added lkml and other maintainers.
drivers/staging/goldfish/goldfish_audio.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/goldfish/goldfish_audio.c b/drivers/staging/goldfish/goldfish_audio.c
index f1e1838..364fdcd 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -280,12 +280,12 @@ static int goldfish_audio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, data);
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (r == NULL) {
+ if (!r) {
dev_err(&pdev->dev, "platform_get_resource failed\n");
return -ENODEV;
}
data->reg_base = devm_ioremap(&pdev->dev, r->start, PAGE_SIZE);
- if (data->reg_base == NULL)
+ if (!data->reg_base)
return -ENOMEM;
data->irq = platform_get_irq(pdev, 0);
@@ -295,7 +295,7 @@ static int goldfish_audio_probe(struct platform_device *pdev)
}
data->buffer_virt = dmam_alloc_coherent(&pdev->dev,
COMBINED_BUFFER_SIZE, &buf_addr, GFP_KERNEL);
- if (data->buffer_virt == NULL) {
+ if (!data->buffer_virt) {
dev_err(&pdev->dev, "allocate buffer failed\n");
return -ENOMEM;
}
--
2.1.4
next prev parent reply other threads:[~2016-01-07 17:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-07 17:38 [PATCH v2 0/2] Staging: goldfish: Checkpatch cleanups Shraddha Barke
2016-01-07 17:38 ` [PATCH v2 1/2] Staging: goldfish: Add space around + Shraddha Barke
2016-01-07 17:38 ` Shraddha Barke [this message]
2016-02-08 2:30 ` [PATCH v2 0/2] Staging: goldfish: Checkpatch cleanups Greg Kroah-Hartman
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=1452188318-8184-3-git-send-email-shraddha.6596@gmail.com \
--to=shraddha.6596@gmail.com \
--cc=alan@linux.intel.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jinqian@google.com \
--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;
as well as URLs for NNTP newsgroup(s).