[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140209092229.GG19429@gondor.apana.org.au>
Date: Sun, 9 Feb 2014 17:22:29 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Rusty Russell <rusty@...tcorp.com.au>
Cc: Dan Carpenter <dan.carpenter@...cle.com>,
Matt Mackall <mpm@...enic.com>,
Satoru Takeuchi <satoru.takeuchi@...il.com>,
Paul Gortmaker <paul.gortmaker@...driver.com>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [patch] hw_random: cleanup in hwrng_register()
On Fri, Jan 31, 2014 at 04:18:51PM +1030, Rusty Russell wrote:
> Dan Carpenter <dan.carpenter@...cle.com> writes:
> > 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: Dan Carpenter <dan.carpenter@...cle.com>
>
> Yeah, clearer too.
>
> Reviewed-by: Rusty Russell <rusty@...tcorp.com.au>
Patch applied.
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists