lkml.org 
[lkml]   [2018]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH 20/20] platform: goldfish: pipe: Replace "x==NULL" to "!x"
From
From: Roman Kiryanov <rkir@google.com>

checkpatch: Comparison to NULL could be written "!x"

Signed-off-by: Roman Kiryanov <rkir@google.com>
---
drivers/platform/goldfish/goldfish_pipe.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
index c892a0447a81..b4a484bbcdaa 100644
--- a/drivers/platform/goldfish/goldfish_pipe.c
+++ b/drivers/platform/goldfish/goldfish_pipe.c
@@ -699,7 +699,7 @@ static int goldfish_pipe_open(struct inode *inode, struct file *file)

/* Allocate new pipe kernel object */
struct goldfish_pipe *pipe = kzalloc(sizeof(*pipe), GFP_KERNEL);
- if (pipe == NULL)
+ if (!pipe)
return -ENOMEM;

pipe->dev = dev;
@@ -865,23 +865,23 @@ static int goldfish_pipe_probe(struct platform_device *pdev)
struct goldfish_pipe_dev *dev = &goldfish_pipe_dev;

/* not thread safe, but this should not happen */
- WARN_ON(dev->base != NULL);
+ WARN_ON(dev->base);

spin_lock_init(&dev->lock);

r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (r == NULL || resource_size(r) < PAGE_SIZE) {
+ if (!r || resource_size(r) < PAGE_SIZE) {
dev_err(&pdev->dev, "can't allocate i/o page\n");
return -EINVAL;
}
dev->base = devm_ioremap(&pdev->dev, r->start, PAGE_SIZE);
- if (dev->base == NULL) {
+ if (!dev->base) {
dev_err(&pdev->dev, "ioremap failed\n");
return -EINVAL;
}

r = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
- if (r == NULL) {
+ if (!r) {
err = -EINVAL;
goto error;
}
--
2.19.0.rc0.228.g281dcd1b4d0-goog
\
 
 \ /
  Last update: 2018-08-27 20:25    [W:0.133 / U:1.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site