From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Sughosh Ganu <sughosh.ganu@linaro.org>
Cc: u-boot@lists.denx.de, Simon Glass <sjg@chromium.org>,
Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: Re: [PATCH v3 1/8] tpm: rng: Change tpm_get_random to return an int
Date: Wed, 9 Mar 2022 09:36:53 +0200 [thread overview]
Message-ID: <YihZFeeWKAuj+S3G@hades> (raw)
In-Reply-To: <20220304133429.1047752-2-sughosh.ganu@linaro.org>
On Fri, Mar 04, 2022 at 07:04:22PM +0530, Sughosh Ganu wrote:
> The tpm random number generation functionality will be moved to the
> driver model. With that, the tpm_get_random function will call the
> common driver model api instead of separate functions for tpmv1 and
> tpmv2. Return an int instead of a u32 to comply with the return value
> of the driver model function.
>
> Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes since V2: None
>
> include/tpm_api.h | 4 ++--
> lib/tpm_api.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/tpm_api.h b/include/tpm_api.h
> index 11aa14eb79..249a966942 100644
> --- a/include/tpm_api.h
> +++ b/include/tpm_api.h
> @@ -274,9 +274,9 @@ u32 tpm_find_key_sha1(struct udevice *dev, const u8 auth[20],
> * @param dev TPM device
> * @param data output buffer for the random bytes
> * @param count size of output buffer
> - * Return: return code of the operation
> + * Return: 0 if OK, -ve on error
> */
> -u32 tpm_get_random(struct udevice *dev, void *data, u32 count);
> +int tpm_get_random(struct udevice *dev, void *data, u32 count);
>
> /**
> * tpm_finalise_physical_presence() - Finalise physical presence
> diff --git a/lib/tpm_api.c b/lib/tpm_api.c
> index 4ac4612c81..7d26ea2c3a 100644
> --- a/lib/tpm_api.c
> +++ b/lib/tpm_api.c
> @@ -264,7 +264,7 @@ u32 tpm_get_permissions(struct udevice *dev, u32 index, u32 *perm)
> return -ENOSYS;
> }
>
> -u32 tpm_get_random(struct udevice *dev, void *data, u32 count)
> +int tpm_get_random(struct udevice *dev, void *data, u32 count)
> {
> if (tpm_is_v1(dev))
> return tpm1_get_random(dev, data, count);
> --
> 2.25.1
>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
next prev parent reply other threads:[~2022-03-09 7:37 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-04 13:34 [PATCH v3 0/8] tpm: rng: Move TPM RNG functionality to driver model Sughosh Ganu
2022-03-04 13:34 ` [PATCH v3 1/8] tpm: rng: Change tpm_get_random to return an int Sughosh Ganu
2022-03-09 7:36 ` Ilias Apalodimas [this message]
2022-03-04 13:34 ` [PATCH v3 2/8] tpm: Fix the return type of tpm_startup Sughosh Ganu
2022-03-09 7:37 ` Ilias Apalodimas
2022-03-04 13:34 ` [PATCH v3 3/8] tpm: rng: Add driver model interface for TPM RNG device Sughosh Ganu
2022-03-09 2:35 ` Simon Glass
2022-03-09 6:00 ` Sughosh Ganu
2022-03-09 11:18 ` Sughosh Ganu
2022-03-12 17:59 ` Simon Glass
2022-03-04 13:34 ` [PATCH v3 4/8] tpm: Add the RNG child device Sughosh Ganu
2022-03-09 2:35 ` Simon Glass
2022-03-09 6:02 ` Sughosh Ganu
2022-03-04 13:34 ` [PATCH v3 5/8] qemu: arm: Remove platform specific function to get RNG device Sughosh Ganu
2022-03-09 2:35 ` Simon Glass
2022-03-09 7:47 ` Ilias Apalodimas
2022-03-04 13:34 ` [PATCH v3 6/8] cmd: rng: Add support for selecting " Sughosh Ganu
2022-03-09 2:35 ` Simon Glass
2022-03-09 6:04 ` Sughosh Ganu
2022-03-09 7:42 ` Ilias Apalodimas
2022-03-09 15:32 ` Simon Glass
2022-03-10 12:42 ` Sughosh Ganu
2022-03-12 17:59 ` Simon Glass
2022-03-04 13:34 ` [PATCH v3 7/8] doc: rng: Add documentation for the rng command Sughosh Ganu
2022-03-09 2:35 ` Simon Glass
2022-03-09 7:39 ` Ilias Apalodimas
2022-03-04 13:34 ` [PATCH v3 8/8] test: rng: Add a UT testcase " Sughosh Ganu
2022-03-09 2:35 ` Simon Glass
2022-03-09 6:18 ` Sughosh Ganu
2022-03-12 2:43 ` Simon Glass
2022-03-13 11:07 ` Sughosh Ganu
2022-03-13 22:23 ` Simon Glass
2022-03-24 16:22 ` Sughosh Ganu
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=YihZFeeWKAuj+S3G@hades \
--to=ilias.apalodimas@linaro.org \
--cc=sjg@chromium.org \
--cc=sughosh.ganu@linaro.org \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/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