Staging: iio: Remove explicit comparison to NULL
authorCristina Opriceana <cristina.opriceana@gmail.com>
Sat, 14 Mar 2015 18:50:48 +0000 (20:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Mar 2015 15:14:05 +0000 (16:14 +0100)
This patch simplifies pointer comparison to NULL and makes code
easier to read. Warning found by checkpatch.pl.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/frequency/ad9832.c
drivers/staging/iio/frequency/ad9834.c

index 9a16699541c2c07d39b19261b337cc836a3da447..8ecc0bc64ee32bba8e6b7d1b637cd4c5cad7c145 100644 (file)
@@ -220,7 +220,7 @@ static int ad9832_probe(struct spi_device *spi)
        }
 
        indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
-       if (indio_dev == NULL) {
+       if (!indio_dev) {
                ret = -ENOMEM;
                goto error_disable_reg;
        }
index a346673063204a82ea26ef71297768d456b32048..efea56012622ba5a143a1fecf76c49ca855881f2 100644 (file)
@@ -336,7 +336,7 @@ static int ad9834_probe(struct spi_device *spi)
        }
 
        indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
-       if (indio_dev == NULL) {
+       if (!indio_dev) {
                ret = -ENOMEM;
                goto error_disable_reg;
        }