mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
d3f31e87db
commit
aa5587f3cb
|
@ -119,7 +119,7 @@ static int lis3l02dq_get_buffer_element(struct iio_dev *indio_dev,
|
||||||
indio_dev->masklength);
|
indio_dev->masklength);
|
||||||
|
|
||||||
rx_array = kcalloc(4, scan_count, GFP_KERNEL);
|
rx_array = kcalloc(4, scan_count, GFP_KERNEL);
|
||||||
if (rx_array == NULL)
|
if (!rx_array)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
ret = lis3l02dq_read_all(indio_dev, rx_array);
|
ret = lis3l02dq_read_all(indio_dev, rx_array);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
@ -142,7 +142,7 @@ static irqreturn_t lis3l02dq_trigger_handler(int irq, void *p)
|
||||||
char *data;
|
char *data;
|
||||||
|
|
||||||
data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
|
data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
|
||||||
if (data == NULL)
|
if (!data)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength))
|
if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength))
|
||||||
|
@ -412,7 +412,7 @@ int lis3l02dq_configure_buffer(struct iio_dev *indio_dev)
|
||||||
"lis3l02dq_consumer%d",
|
"lis3l02dq_consumer%d",
|
||||||
indio_dev->id);
|
indio_dev->id);
|
||||||
|
|
||||||
if (indio_dev->pollfunc == NULL) {
|
if (!indio_dev->pollfunc) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto error_iio_sw_rb_free;
|
goto error_iio_sw_rb_free;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue