Skip to content

Commit

Permalink
hwrng: core - rewrite better comparison to NULL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Corentin LABBE authored and Herbert Xu committed Dec 27, 2016
1 parent 6bc17d9 commit 2a971e3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/char/hw_random/core.c
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 2a971e3

Please sign in to comment.