Staging: iio: adc: Remove explicit NULL comparison
authorCristina Opriceana <cristina.opriceana@gmail.com>
Tue, 31 Mar 2015 10:04:07 +0000 (13:04 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Apr 2015 15:23:21 +0000 (17:23 +0200)
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>
drivers/staging/iio/adc/ad7606_ring.c
drivers/staging/iio/adc/ad7780.c

index 3bf174cb19b1ef3573482896fef1848a3f7941ff..a6f8eb11242c124cc292e74594e16320bf092f9f 100644 (file)
@@ -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)) {
index 66a157be2eaf61d612d81ba8a99c81ba7a41c0a0..9f03fe3ee3d93ee34c78ca23be867fdc59d7f706 100644 (file)
@@ -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);