summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/iio_simple_dummy_buffer.c
diff options
context:
space:
mode:
authorCristina Opriceana <cristina.opriceana@gmail.com>2015-03-31 12:51:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-04-01 17:23:20 +0200
commit8f94c31feeba8b872ed18d075b57de5d04575d05 (patch)
tree3b580147f55f887199b370389502ca1b22b314c8 /drivers/staging/iio/iio_simple_dummy_buffer.c
parent025c7da9eeba3a6c77ef9485a4c1c1a797dd7a4e (diff)
Staging: iio: iio_simple_dummy: Remove explicit NULL comparison
This patch removes explicit NULL comparison and writes it in its simpler form. Done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/iio/iio_simple_dummy_buffer.c')
-rw-r--r--drivers/staging/iio/iio_simple_dummy_buffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/iio/iio_simple_dummy_buffer.c b/drivers/staging/iio/iio_simple_dummy_buffer.c
index 360a4c980722..a651b8922d0a 100644
--- a/drivers/staging/iio/iio_simple_dummy_buffer.c
+++ b/drivers/staging/iio/iio_simple_dummy_buffer.c
@@ -50,7 +50,7 @@ static irqreturn_t iio_simple_dummy_trigger_h(int irq, void *p)
u16 *data;
data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
- if (data == NULL)
+ if (!data)
goto done;
if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength)) {
@@ -122,7 +122,7 @@ int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev)
/* Allocate a buffer to use - here a kfifo */
buffer = iio_kfifo_allocate();
- if (buffer == NULL) {
+ if (!buffer) {
ret = -ENOMEM;
goto error_ret;
}
@@ -161,7 +161,7 @@ int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev)
"iio_simple_dummy_consumer%d",
indio_dev->id);
- if (indio_dev->pollfunc == NULL) {
+ if (!indio_dev->pollfunc) {
ret = -ENOMEM;
goto error_free_buffer;
}