summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe.montjoie@gmail.com>2016-12-13 15:51:10 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2016-12-27 10:49:09 +0100
commit2a971e3b248775f808950bdc0ac75f12a2853eff (patch)
treeeadaacb4b48cfe0a59a66a9d4daf3a5816e92a05 /drivers/char
parenthwrng: core - do not use multiple blank lines (diff)
downloadlinux-2a971e3b248775f808950bdc0ac75f12a2853eff.tar.xz
linux-2a971e3b248775f808950bdc0ac75f12a2853eff.zip
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/char')
-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);