staging: iio: meter: Remove explicit comparisons
authorCristina Moraru <cristina.moraru09@gmail.com>
Tue, 20 Oct 2015 19:55:41 +0000 (22:55 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Oct 2015 02:32:09 +0000 (19:32 -0700)
Remove comparisons to 0 or NULL

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/meter/ade7753.c
drivers/staging/iio/meter/ade7754.c
drivers/staging/iio/meter/ade7759.c
drivers/staging/iio/meter/ade7854-spi.c

index 3d2e50cfe9a3542b22a3265ac4164f4b18dc6abc..188830d7e2574109592fae90d66ab09a4579214d 100644 (file)
@@ -406,7 +406,7 @@ static ssize_t ade7753_write_frequency(struct device *dev,
        ret = kstrtou16(buf, 10, &val);
        if (ret)
                return ret;
-       if (val == 0)
+       if (!val)
                return -EINVAL;
 
        mutex_lock(&indio_dev->mlock);
index 8552c76cbbe76f998fbdde27388abba57edd868b..664c6e5f76b13e872484d19328c163a9446eebcf 100644 (file)
@@ -438,7 +438,7 @@ static ssize_t ade7754_write_frequency(struct device *dev,
        ret = kstrtou16(buf, 10, &val);
        if (ret)
                return ret;
-       if (val == 0)
+       if (!val)
                return -EINVAL;
 
        mutex_lock(&indio_dev->mlock);
index 23e7392070277eb525dda97d77999b727f66c5f4..11c1edcc1ed638478fd2c3ba4ebba477fbd52f60 100644 (file)
@@ -377,7 +377,7 @@ static ssize_t ade7759_write_frequency(struct device *dev,
        ret = kstrtou16(buf, 10, &val);
        if (ret)
                return ret;
-       if (val == 0)
+       if (!val)
                return -EINVAL;
 
        mutex_lock(&indio_dev->mlock);
index 9b255a5f62c33822ecb8d255799887c6a4ee7cf6..da774866512c3828d33b0bdffe34e252f71551ea 100644 (file)
@@ -278,7 +278,7 @@ static int ade7854_spi_probe(struct spi_device *spi)
        struct iio_dev *indio_dev;
 
        indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
-       if (indio_dev == NULL)
+       if (!indio_dev)
                return -ENOMEM;
        st = iio_priv(indio_dev);
        spi_set_drvdata(spi, indio_dev);