Commit bfb8e838 authored by Roman Kiryanov's avatar Roman Kiryanov Committed by Greg Kroah-Hartman

platform: goldfish: pipe: Replace "x==NULL" to "!x"

checkpatch: Comparison to NULL could be written "!x"
Signed-off-by: default avatarRoman Kiryanov <rkir@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cc14057f
...@@ -699,7 +699,7 @@ static int goldfish_pipe_open(struct inode *inode, struct file *file) ...@@ -699,7 +699,7 @@ static int goldfish_pipe_open(struct inode *inode, struct file *file)
/* Allocate new pipe kernel object */ /* Allocate new pipe kernel object */
struct goldfish_pipe *pipe = kzalloc(sizeof(*pipe), GFP_KERNEL); struct goldfish_pipe *pipe = kzalloc(sizeof(*pipe), GFP_KERNEL);
if (pipe == NULL) if (!pipe)
return -ENOMEM; return -ENOMEM;
pipe->dev = dev; pipe->dev = dev;
...@@ -865,23 +865,23 @@ static int goldfish_pipe_probe(struct platform_device *pdev) ...@@ -865,23 +865,23 @@ static int goldfish_pipe_probe(struct platform_device *pdev)
struct goldfish_pipe_dev *dev = &goldfish_pipe_dev; struct goldfish_pipe_dev *dev = &goldfish_pipe_dev;
/* not thread safe, but this should not happen */ /* not thread safe, but this should not happen */
WARN_ON(dev->base != NULL); WARN_ON(dev->base);
spin_lock_init(&dev->lock); spin_lock_init(&dev->lock);
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 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"); dev_err(&pdev->dev, "can't allocate i/o page\n");
return -EINVAL; return -EINVAL;
} }
dev->base = devm_ioremap(&pdev->dev, r->start, PAGE_SIZE); dev->base = devm_ioremap(&pdev->dev, r->start, PAGE_SIZE);
if (dev->base == NULL) { if (!dev->base) {
dev_err(&pdev->dev, "ioremap failed\n"); dev_err(&pdev->dev, "ioremap failed\n");
return -EINVAL; return -EINVAL;
} }
r = platform_get_resource(pdev, IORESOURCE_IRQ, 0); r = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (r == NULL) { if (!r) {
err = -EINVAL; err = -EINVAL;
goto error; goto error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment