From: Kent Yoder <key@linux.vnet.ibm.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: James Morris <jmorris@namei.org>,
linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org,
tpmdd-devel@lists.sourceforge.net,
Peter Huewe <peter.huewe@infineon.com>,
Bryan Freed <bfreed@chromium.org>
Subject: Re: [GIT PULL] New TPM driver, hwrng driver and fixes
Date: Fri, 27 Jul 2012 14:36:54 -0500 [thread overview]
Message-ID: <20120727193654.GA11027@linux.vnet.ibm.com> (raw)
In-Reply-To: <5012DCF9.7010408@zytor.com>
> Since you no longer modify *max anywhere in this function, why leave it
> a pointer? Making it pass by value seems more logical at that point
> (and cleaner).
>
> The only consumer which can make use of partial result is
> tpm_rng_read(), but that will now return zero unless the buffer is filled.
>
> My suggestion would be to drop the pointer and instead return a positive
> result (number of bytes) if you read anything and a negative result
> (-errno) on error.
Sounds good. I'll make this change.
Kent
> That way, a caller which can only use an exact number of bytes should do:
>
> rv = tpm_get_random(chip, buf, size);
> if (rv != size)
> /* error! */
>
> ... and tpm_rng_read() can do something smarter.
>
> -hpa
>
next prev parent reply other threads:[~2012-07-27 19:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-27 18:14 [GIT PULL] New TPM driver, hwrng driver and fixes Kent Yoder
2012-07-27 18:24 ` H. Peter Anvin
2012-07-27 19:36 ` Kent Yoder [this message]
2012-07-27 20:30 ` Kent Yoder
2012-07-27 22:09 ` H. Peter Anvin
2012-07-28 0:45 ` Kent Yoder
2012-07-30 20:51 ` Kent Yoder
2012-07-30 20:52 ` H. Peter Anvin
2012-08-13 20:44 ` H. Peter Anvin
2012-08-14 16:37 ` Kent Yoder
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=20120727193654.GA11027@linux.vnet.ibm.com \
--to=key@linux.vnet.ibm.com \
--cc=bfreed@chromium.org \
--cc=hpa@zytor.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=peter.huewe@infineon.com \
--cc=tpmdd-devel@lists.sourceforge.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.