From 062f782b37059f7156e59f46c71225ba4a5efa06 Mon Sep 17 00:00:00 2001 From: Cristina Moraru Date: Tue, 20 Oct 2015 22:55:41 +0300 Subject: [PATCH] staging: iio: meter: Remove explicit comparisons Remove comparisons to 0 or NULL Signed-off-by: Cristina Moraru Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/meter/ade7753.c | 2 +- drivers/staging/iio/meter/ade7754.c | 2 +- drivers/staging/iio/meter/ade7759.c | 2 +- drivers/staging/iio/meter/ade7854-spi.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c index 3d2e50cfe9a3..188830d7e257 100644 --- a/drivers/staging/iio/meter/ade7753.c +++ b/drivers/staging/iio/meter/ade7753.c @@ -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); diff --git a/drivers/staging/iio/meter/ade7754.c b/drivers/staging/iio/meter/ade7754.c index 8552c76cbbe7..664c6e5f76b1 100644 --- a/drivers/staging/iio/meter/ade7754.c +++ b/drivers/staging/iio/meter/ade7754.c @@ -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); diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c index 23e739207027..11c1edcc1ed6 100644 --- a/drivers/staging/iio/meter/ade7759.c +++ b/drivers/staging/iio/meter/ade7759.c @@ -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); diff --git a/drivers/staging/iio/meter/ade7854-spi.c b/drivers/staging/iio/meter/ade7854-spi.c index 9b255a5f62c3..da774866512c 100644 --- a/drivers/staging/iio/meter/ade7854-spi.c +++ b/drivers/staging/iio/meter/ade7854-spi.c @@ -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); -- 2.20.1