Skip to content

Commit

Permalink
Staging: iio: meter: Remove explicit NULL comparison
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
cristina2689 authored and gregkh committed Apr 1, 2015
1 parent 8f94c31 commit 4529757
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/iio/meter/ade7758_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/iio/meter/ade7758_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/iio/meter/ade7758_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4529757

Please sign in to comment.