diff options
author | Cristina Moraru <cristina.moraru09@gmail.com> | 2015-10-20 22:55:40 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-24 19:32:09 -0700 |
commit | d59b7b68344df4a2a9eb31e0d667692bfa43a690 (patch) | |
tree | 15ce417e9a29ecb6d21a8e7ca55d92edeba32e7c /drivers/staging/iio | |
parent | 9efbbfada99cd553fa16f66a49b98acf011080a9 (diff) |
staging: iio: light: Remove explicit comparisons
Remove comparisons to 0 or NULL
Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r-- | drivers/staging/iio/light/isl29018.c | 4 | ||||
-rw-r--r-- | drivers/staging/iio/light/tsl2583.c | 6 | ||||
-rw-r--r-- | drivers/staging/iio/light/tsl2x7x_core.c | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c index 019ba5245c23..73109dd40114 100644 --- a/drivers/staging/iio/light/isl29018.c +++ b/drivers/staging/iio/light/isl29018.c @@ -370,7 +370,7 @@ static int isl29018_write_raw(struct iio_dev *indio_dev, break; case IIO_CHAN_INFO_INT_TIME: if (chan->type == IIO_LIGHT) { - if (val != 0) { + if (val) { mutex_unlock(&chip->lock); return -EINVAL; } @@ -716,7 +716,7 @@ static int isl29018_probe(struct i2c_client *client, int dev_id = 0; indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*chip)); - if (indio_dev == NULL) { + if (!indio_dev) { dev_err(&client->dev, "iio allocation fails\n"); return -ENOMEM; } diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c index df602038a4bd..3100d960fe2c 100644 --- a/drivers/staging/iio/light/tsl2583.c +++ b/drivers/staging/iio/light/tsl2583.c @@ -263,7 +263,7 @@ static int taos_get_lux(struct iio_dev *indio_dev) if ((ch0 >= chip->als_saturation) || (ch1 >= chip->als_saturation)) goto return_max; - if (ch0 == 0) { + if (!ch0) { /* have no data, so return LAST VALUE */ ret = chip->als_cur_info.lux = 0; goto out_unlock; @@ -415,7 +415,7 @@ static int taos_chip_on(struct iio_dev *indio_dev) /* determine als integration register */ als_count = (chip->taos_settings.als_time * 100 + 135) / 270; - if (als_count == 0) + if (!als_count) als_count = 1; /* ensure at least one cycle */ /* convert back to time (encompasses overrides) */ @@ -499,7 +499,7 @@ static ssize_t taos_power_state_store(struct device *dev, if (kstrtoint(buf, 0, &value)) return -EINVAL; - if (value == 0) + if (!value) taos_chip_off(indio_dev); else taos_chip_on(indio_dev); diff --git a/drivers/staging/iio/light/tsl2x7x_core.c b/drivers/staging/iio/light/tsl2x7x_core.c index bf9627ea2ffb..9dfd04855a1b 100644 --- a/drivers/staging/iio/light/tsl2x7x_core.c +++ b/drivers/staging/iio/light/tsl2x7x_core.c @@ -403,7 +403,7 @@ static int tsl2x7x_get_lux(struct iio_dev *indio_dev) goto return_max; } - if (ch0 == 0) { + if (!ch0) { /* have no data, so return LAST VALUE */ ret = chip->als_cur_info.lux; goto out_unlock; @@ -678,7 +678,7 @@ static int tsl2x7x_chip_on(struct iio_dev *indio_dev) /* determine als integration register */ als_count = (chip->tsl2x7x_settings.als_time * 100 + 135) / 270; - if (als_count == 0) + if (!als_count) als_count = 1; /* ensure at least one cycle */ /* convert back to time (encompasses overrides) */ @@ -825,7 +825,7 @@ void tsl2x7x_prox_calculate(int *data, int length, int sample_sum; int tmp; - if (length == 0) + if (!length) length = 1; sample_sum = 0; |