diff options
author | Cristina Opriceana <cristina.opriceana@gmail.com> | 2015-03-31 06:04:29 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-04-01 11:23:21 -0400 |
commit | aa5587f3cb9fde2db852b5549ee561198aa95748 (patch) | |
tree | ed76c4b30c4ec85ffbc375509959c50b6e743567 | |
parent | d3f31e87dbcc2c6d3a9cf28e1404cf43ef265ebe (diff) |
Staging: iio: accel: Remove explicit NULL comparison
This patch removes explicit NULL comparison and writes it in its
equivalent shorter form. Done with coccinelle.
@replace_rule@
expression e;
@@
-e == NULL
+ !e
Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/iio/accel/lis3l02dq_ring.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/iio/accel/lis3l02dq_ring.c b/drivers/staging/iio/accel/lis3l02dq_ring.c index 20435b5ce5ef..b892f2cf5f9e 100644 --- a/drivers/staging/iio/accel/lis3l02dq_ring.c +++ b/drivers/staging/iio/accel/lis3l02dq_ring.c | |||
@@ -119,7 +119,7 @@ static int lis3l02dq_get_buffer_element(struct iio_dev *indio_dev, | |||
119 | indio_dev->masklength); | 119 | indio_dev->masklength); |
120 | 120 | ||
121 | rx_array = kcalloc(4, scan_count, GFP_KERNEL); | 121 | rx_array = kcalloc(4, scan_count, GFP_KERNEL); |
122 | if (rx_array == NULL) | 122 | if (!rx_array) |
123 | return -ENOMEM; | 123 | return -ENOMEM; |
124 | ret = lis3l02dq_read_all(indio_dev, rx_array); | 124 | ret = lis3l02dq_read_all(indio_dev, rx_array); |
125 | if (ret < 0) { | 125 | if (ret < 0) { |
@@ -142,7 +142,7 @@ static irqreturn_t lis3l02dq_trigger_handler(int irq, void *p) | |||
142 | char *data; | 142 | char *data; |
143 | 143 | ||
144 | data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); | 144 | data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); |
145 | if (data == NULL) | 145 | if (!data) |
146 | goto done; | 146 | goto done; |
147 | 147 | ||
148 | if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength)) | 148 | if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength)) |
@@ -412,7 +412,7 @@ int lis3l02dq_configure_buffer(struct iio_dev *indio_dev) | |||
412 | "lis3l02dq_consumer%d", | 412 | "lis3l02dq_consumer%d", |
413 | indio_dev->id); | 413 | indio_dev->id); |
414 | 414 | ||
415 | if (indio_dev->pollfunc == NULL) { | 415 | if (!indio_dev->pollfunc) { |
416 | ret = -ENOMEM; | 416 | ret = -ENOMEM; |
417 | goto error_iio_sw_rb_free; | 417 | goto error_iio_sw_rb_free; |
418 | } | 418 | } |