From: Corentin LABBE Date: Tue, 13 Dec 2016 14:51:10 +0000 (+0100) Subject: hwrng: core - rewrite better comparison to NULL X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2a971e3b248775f808950bdc0ac75f12a2853eff;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Herbert Xu --- 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);