summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe.montjoie@gmail.com>2016-12-13 17:51:10 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2016-12-27 12:49:09 +0300
commit2a971e3b248775f808950bdc0ac75f12a2853eff (patch)
treeeadaacb4b48cfe0a59a66a9d4daf3a5816e92a05 /drivers
parent6bc17d90e62d16828d1a2113b54cfa4e04582fb6 (diff)
downloadlinux-2a971e3b248775f808950bdc0ac75f12a2853eff.tar.xz
hwrng: core - rewrite better comparison to NULL
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/hw_random/core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index 4d03b9798e25..3e565e12f397 100644
--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -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);