diff options
author | Corentin LABBE <clabbe.montjoie@gmail.com> | 2016-12-13 15:51:10 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-12-27 10:49:09 +0100 |
commit | 2a971e3b248775f808950bdc0ac75f12a2853eff (patch) | |
tree | eadaacb4b48cfe0a59a66a9d4daf3a5816e92a05 /drivers/char | |
parent | hwrng: core - do not use multiple blank lines (diff) | |
download | linux-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.c | 3 |
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); |