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>
This commit is contained in:
parent
6bc17d90e6
commit
2a971e3b24
@ -442,8 +442,7 @@ int hwrng_register(struct hwrng *rng)
|
|||||||
int err = -EINVAL;
|
int err = -EINVAL;
|
||||||
struct hwrng *old_rng, *tmp;
|
struct hwrng *old_rng, *tmp;
|
||||||
|
|
||||||
if (rng->name == NULL ||
|
if (!rng->name || (!rng->data_read && !rng->read))
|
||||||
(rng->data_read == NULL && rng->read == NULL))
|
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
mutex_lock(&rng_mutex);
|
mutex_lock(&rng_mutex);
|
||||||
|
Loading…
Reference in New Issue
Block a user