hwrng: core - rewrite better comparison to NULL
authorCorentin LABBE <clabbe.montjoie@gmail.com>
Tue, 13 Dec 2016 14:51:10 +0000 (15:51 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 27 Dec 2016 09:49:09 +0000 (17:49 +0800)
This patch fix the checkpatch warning "Comparison to NULL could be written "!ptr"

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/core.c

index 4d03b9798e25ea6397b69750d498824cfb487291..3e565e12f3974030148da02db8b6770034bf44ae 100644 (file)
@@ -442,8 +442,7 @@ int hwrng_register(struct hwrng *rng)
        int err = -EINVAL;
        struct hwrng *old_rng, *tmp;
 
-       if (rng->name == NULL ||
-           (rng->data_read == NULL && rng->read == NULL))
+       if (!rng->name || (!rng->data_read && !rng->read))
                goto out;
 
        mutex_lock(&rng_mutex);