Skip to content

Commit

Permalink
Staging: iio: iio_dummy_evgen: Simplify NULL comparison
Browse files Browse the repository at this point in the history
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 <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Cristina Opriceana authored and Greg Kroah-Hartman committed Apr 1, 2015
1 parent b72eb70 commit 025c7da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/iio/iio_dummy_evgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 025c7da

Please sign in to comment.