Skip to content
Commit d167b6e1 authored by Dan Carpenter's avatar Dan Carpenter Committed by Herbert Xu
Browse files

hwrng: cleanup in hwrng_register()



My static checker complains that:

	drivers/char/hw_random/core.c:341 hwrng_register()
	warn: we tested 'old_rng' before and it was 'false'

The problem is that sometimes we test "if (!old_rng)" and sometimes we
test "if (must_register_misc)".  The static checker knows they are
equivalent but a human being reading the code could easily be confused.

I have simplified the code by removing the "must_register_misc" variable
and I have removed the redundant check on "if (!old_rng)".

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent fecfd7f7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment