Skip to content

Commit

Permalink
Staging: iio: adc: Remove explicit NULL comparison
Browse files Browse the repository at this point in the history
This patch removes explicit NULL comparison and writes it in its
shorter form. Detected with coccinelle.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Cristina Opriceana authored and Greg Kroah-Hartman committed Apr 1, 2015
1 parent 16d55be commit d3f31e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/iio/adc/ad7606_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static void ad7606_poll_bh_to_ring(struct work_struct *work_s)
int ret;

buf = kzalloc(indio_dev->scan_bytes, GFP_KERNEL);
if (buf == NULL)
if (!buf)
return;

if (gpio_is_valid(st->pdata->gpio_frstdata)) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/iio/adc/ad7780.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static int ad7780_probe(struct spi_device *spi)
int ret, voltage_uv = 0;

indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
if (indio_dev == NULL)
if (!indio_dev)
return -ENOMEM;

st = iio_priv(indio_dev);
Expand Down

0 comments on commit d3f31e8

Please sign in to comment.