From: Herbert Xu <herbert@gondor.apana.org.au>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
Matt Mackall <mpm@selenic.com>,
Satoru Takeuchi <satoru.takeuchi@gmail.com>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] hw_random: cleanup in hwrng_register()
Date: Sun, 9 Feb 2014 17:22:29 +0800 [thread overview]
Message-ID: <20140209092229.GG19429@gondor.apana.org.au> (raw)
In-Reply-To: <87k3dgvgzg.fsf@rustcorp.com.au>
On Fri, Jan 31, 2014 at 04:18:51PM +1030, Rusty Russell wrote:
> Dan Carpenter <dan.carpenter@oracle.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@oracle.com>
>
> Yeah, clearer too.
>
> Reviewed-by: Rusty Russell <rusty@rustcorp.com.au>
Patch applied.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
prev parent reply other threads:[~2014-02-09 9:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-30 11:49 [patch] hw_random: cleanup in hwrng_register() Dan Carpenter
2014-01-31 5:48 ` Rusty Russell
2014-02-09 9:22 ` Herbert Xu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140209092229.GG19429@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
--cc=paul.gortmaker@windriver.com \
--cc=rusty@rustcorp.com.au \
--cc=satoru.takeuchi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox