You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Staging: iio: iio_simple_dummy: Remove explicit NULL comparison
This patch removes explicit NULL comparison and writes it in its simpler 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:
committed by
Greg Kroah-Hartman
parent
025c7da9ee
commit
8f94c31fee
@@ -588,7 +588,7 @@ static int iio_dummy_probe(int index)
|
|||||||
* for chip specific state information.
|
* for chip specific state information.
|
||||||
*/
|
*/
|
||||||
indio_dev = iio_device_alloc(sizeof(*st));
|
indio_dev = iio_device_alloc(sizeof(*st));
|
||||||
if (indio_dev == NULL) {
|
if (!indio_dev) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto error_ret;
|
goto error_ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ static irqreturn_t iio_simple_dummy_trigger_h(int irq, void *p)
|
|||||||
u16 *data;
|
u16 *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)) {
|
||||||
@@ -122,7 +122,7 @@ int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev)
|
|||||||
|
|
||||||
/* Allocate a buffer to use - here a kfifo */
|
/* Allocate a buffer to use - here a kfifo */
|
||||||
buffer = iio_kfifo_allocate();
|
buffer = iio_kfifo_allocate();
|
||||||
if (buffer == NULL) {
|
if (!buffer) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto error_ret;
|
goto error_ret;
|
||||||
}
|
}
|
||||||
@@ -161,7 +161,7 @@ int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev)
|
|||||||
"iio_simple_dummy_consumer%d",
|
"iio_simple_dummy_consumer%d",
|
||||||
indio_dev->id);
|
indio_dev->id);
|
||||||
|
|
||||||
if (indio_dev->pollfunc == NULL) {
|
if (!indio_dev->pollfunc) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto error_free_buffer;
|
goto error_free_buffer;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user