diff mbox series

[v3,2/8] tpm: Fix the return type of tpm_startup

Message ID 20220304133429.1047752-3-sughosh.ganu@linaro.org
State Superseded
Headers show
Series tpm: rng: Move TPM RNG functionality to driver model | expand

Commit Message

Sughosh Ganu March 4, 2022, 1:34 p.m. UTC
The tpm_startup function returns negative values for error
conditions. Fix the return type of the function to a signed int
instead of a u32.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes since V2: None

 include/tpm_api.h | 2 +-
 lib/tpm_api.c     | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Ilias Apalodimas March 9, 2022, 7:37 a.m. UTC | #1
On Fri, Mar 04, 2022 at 07:04:23PM +0530, Sughosh Ganu wrote:
> The tpm_startup function returns negative values for error
> conditions. Fix the return type of the function to a signed int
> instead of a u32.
> 
> Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
> 
> Changes since V2: None
> 
>  include/tpm_api.h | 2 +-
>  lib/tpm_api.c     | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/include/tpm_api.h b/include/tpm_api.h
> index 249a966942..4d77a49719 100644
> --- a/include/tpm_api.h
> +++ b/include/tpm_api.h
> @@ -18,7 +18,7 @@
>   * @param mode		TPM startup mode
>   * Return: return code of the operation
>   */
> -u32 tpm_startup(struct udevice *dev, enum tpm_startup_type mode);
> +int tpm_startup(struct udevice *dev, enum tpm_startup_type mode);
>  
>  /**
>   * Issue a TPM_SelfTestFull command.
> diff --git a/lib/tpm_api.c b/lib/tpm_api.c
> index 7d26ea2c3a..da48058abe 100644
> --- a/lib/tpm_api.c
> +++ b/lib/tpm_api.c
> @@ -11,7 +11,8 @@
>  #include <tpm-v2.h>
>  #include <tpm_api.h>
>  
> -u32 tpm_startup(struct udevice *dev, enum tpm_startup_type mode)
> +
> +int tpm_startup(struct udevice *dev, enum tpm_startup_type mode)
>  {
>  	if (tpm_is_v1(dev)) {
>  		return tpm1_startup(dev, mode);
> -- 
> 2.25.1
> 
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff mbox series

Patch

diff --git a/include/tpm_api.h b/include/tpm_api.h
index 249a966942..4d77a49719 100644
--- a/include/tpm_api.h
+++ b/include/tpm_api.h
@@ -18,7 +18,7 @@ 
  * @param mode		TPM startup mode
  * Return: return code of the operation
  */
-u32 tpm_startup(struct udevice *dev, enum tpm_startup_type mode);
+int tpm_startup(struct udevice *dev, enum tpm_startup_type mode);
 
 /**
  * Issue a TPM_SelfTestFull command.
diff --git a/lib/tpm_api.c b/lib/tpm_api.c
index 7d26ea2c3a..da48058abe 100644
--- a/lib/tpm_api.c
+++ b/lib/tpm_api.c
@@ -11,7 +11,8 @@ 
 #include <tpm-v2.h>
 #include <tpm_api.h>
 
-u32 tpm_startup(struct udevice *dev, enum tpm_startup_type mode)
+
+int tpm_startup(struct udevice *dev, enum tpm_startup_type mode)
 {
 	if (tpm_is_v1(dev)) {
 		return tpm1_startup(dev, mode);