Commit 45297571 authored by Cristina Opriceana's avatar Cristina Opriceana Committed by Greg Kroah-Hartman

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: default avatarCristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8f94c31f
...@@ -833,7 +833,7 @@ static int ade7758_probe(struct spi_device *spi) ...@@ -833,7 +833,7 @@ static int ade7758_probe(struct spi_device *spi)
if (!st->rx) if (!st->rx)
return -ENOMEM; return -ENOMEM;
st->tx = kcalloc(ADE7758_MAX_TX, sizeof(*st->tx), GFP_KERNEL); st->tx = kcalloc(ADE7758_MAX_TX, sizeof(*st->tx), GFP_KERNEL);
if (st->tx == NULL) { if (!st->tx) {
ret = -ENOMEM; ret = -ENOMEM;
goto error_free_rx; goto error_free_rx;
} }
......
...@@ -132,7 +132,7 @@ int ade7758_configure_ring(struct iio_dev *indio_dev) ...@@ -132,7 +132,7 @@ int ade7758_configure_ring(struct iio_dev *indio_dev)
indio_dev, indio_dev,
"ade7759_consumer%d", "ade7759_consumer%d",
indio_dev->id); indio_dev->id);
if (indio_dev->pollfunc == NULL) { if (!indio_dev->pollfunc) {
ret = -ENOMEM; ret = -ENOMEM;
goto error_iio_kfifo_free; goto error_iio_kfifo_free;
} }
......
...@@ -66,7 +66,7 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) ...@@ -66,7 +66,7 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev)
st->trig = iio_trigger_alloc("%s-dev%d", st->trig = iio_trigger_alloc("%s-dev%d",
spi_get_device_id(st->us)->name, spi_get_device_id(st->us)->name,
indio_dev->id); indio_dev->id);
if (st->trig == NULL) { if (!st->trig) {
ret = -ENOMEM; ret = -ENOMEM;
goto error_ret; goto error_ret;
} }
......
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