From: Cristina Opriceana Date: Tue, 31 Mar 2015 09:51:10 +0000 (+0300) Subject: Staging: iio: iio_dummy_evgen: Simplify NULL comparison X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=025c7da9eeba3a6c77ef9485a4c1c1a797dd7a4e;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Staging: iio: iio_dummy_evgen: Simplify NULL comparison Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Cristina Opriceana Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/iio_dummy_evgen.c b/drivers/staging/iio/iio_dummy_evgen.c index 59ad5a3efe9c..0c9c86d7b509 100644 --- a/drivers/staging/iio/iio_dummy_evgen.c +++ b/drivers/staging/iio/iio_dummy_evgen.c @@ -72,7 +72,7 @@ static int iio_dummy_evgen_create(void) int ret, i; iio_evgen = kzalloc(sizeof(*iio_evgen), GFP_KERNEL); - if (iio_evgen == NULL) + if (!iio_evgen) return -ENOMEM; iio_evgen->base = irq_alloc_descs(-1, 0, IIO_EVENTGEN_NO, 0); @@ -105,7 +105,7 @@ int iio_dummy_evgen_get_irq(void) { int i, ret = 0; - if (iio_evgen == NULL) + if (!iio_evgen) return -ENODEV; mutex_lock(&iio_evgen->lock);