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 17:49:09 +0800 |
commit | 2a971e3b248775f808950bdc0ac75f12a2853eff (patch) | |
tree | eadaacb4b48cfe0a59a66a9d4daf3a5816e92a05 /drivers/char/hw_random | |
parent | 6bc17d90e62d16828d1a2113b54cfa4e04582fb6 (diff) | |
download | op-kernel-dev-2a971e3b248775f808950bdc0ac75f12a2853eff.zip op-kernel-dev-2a971e3b248775f808950bdc0ac75f12a2853eff.tar.gz |
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/hw_random')
-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 4d03b97..3e565e1 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); |