diff options
author | Cristina Opriceana <cristina.opriceana@gmail.com> | 2015-03-31 13:01:18 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-04-01 18:23:20 +0300 |
commit | 45297571e90bd59195011ae8e328dae84534ecef (patch) | |
tree | 456fe2da09de66d302ff4ab2b2d37609d3751048 /drivers/staging/iio | |
parent | 8f94c31feeba8b872ed18d075b57de5d04575d05 (diff) | |
download | linux-45297571e90bd59195011ae8e328dae84534ecef.tar.xz |
Staging: iio: meter: Remove explicit NULL comparison
This patch removes explicit NULL comparison and replaces it with
its shorter form. Detected 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')
-rw-r--r-- | drivers/staging/iio/meter/ade7758_core.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7758_ring.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7758_trigger.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/iio/meter/ade7758_core.c b/drivers/staging/iio/meter/ade7758_core.c index 652aa1069b06..77141ae1349d 100644 --- a/drivers/staging/iio/meter/ade7758_core.c +++ b/drivers/staging/iio/meter/ade7758_core.c @@ -833,7 +833,7 @@ static int ade7758_probe(struct spi_device *spi) if (!st->rx) return -ENOMEM; st->tx = kcalloc(ADE7758_MAX_TX, sizeof(*st->tx), GFP_KERNEL); - if (st->tx == NULL) { + if (!st->tx) { ret = -ENOMEM; goto error_free_rx; } diff --git a/drivers/staging/iio/meter/ade7758_ring.c b/drivers/staging/iio/meter/ade7758_ring.c index ead38a50b25b..9a24e0226f8b 100644 --- a/drivers/staging/iio/meter/ade7758_ring.c +++ b/drivers/staging/iio/meter/ade7758_ring.c @@ -132,7 +132,7 @@ int ade7758_configure_ring(struct iio_dev *indio_dev) indio_dev, "ade7759_consumer%d", indio_dev->id); - if (indio_dev->pollfunc == NULL) { + if (!indio_dev->pollfunc) { ret = -ENOMEM; goto error_iio_kfifo_free; } diff --git a/drivers/staging/iio/meter/ade7758_trigger.c b/drivers/staging/iio/meter/ade7758_trigger.c index 6f45ce0478d7..5b35a7f08f4f 100644 --- a/drivers/staging/iio/meter/ade7758_trigger.c +++ b/drivers/staging/iio/meter/ade7758_trigger.c @@ -66,7 +66,7 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) st->trig = iio_trigger_alloc("%s-dev%d", spi_get_device_id(st->us)->name, indio_dev->id); - if (st->trig == NULL) { + if (!st->trig) { ret = -ENOMEM; goto error_ret; } |