diff mbox series

[next,v5,01/12] image: fit: Fix parameter name for hash algorithm

Message ID 20211004015419.8190-2-chiawei_wang@aspeedtech.com
State Superseded
Delegated to: Tom Rini
Headers show
Series aspeed: Support secure boot chain with FIT image verification | expand

Commit Message

ChiaWei Wang Oct. 4, 2021, 1:54 a.m. UTC
Fix inconsistent function parameter name of the hash algorithm.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Fixes: 92055e138f2 ("image: Drop if/elseif hash selection in calculate_hash()")
---
 common/image-fit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass Oct. 14, 2021, 3:09 p.m. UTC | #1
Hi Chia-Wei,

On Sun, 3 Oct 2021 at 19:54, Chia-Wei Wang <chiawei_wang@aspeedtech.com> wrote:
>
> Fix inconsistent function parameter name of the hash algorithm.
>
> Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
> Fixes: 92055e138f2 ("image: Drop if/elseif hash selection in calculate_hash()")
> ---
>  common/image-fit.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/image-fit.c b/common/image-fit.c
> index 5a0a0cc200..9e8a1f36c1 100644
> --- a/common/image-fit.c
> +++ b/common/image-fit.c
> @@ -1229,7 +1229,7 @@ int calculate_hash(const void *data, int data_len, const char *name,
>                 return -1;
>         }
>
> -       hash_algo = hash_algo_lookup_by_name(algo);
> +       hash_algo = hash_algo_lookup_by_name(name);
>         if (hash_algo == HASH_ALGO_INVALID) {
>                 debug("Unsupported hash algorithm\n");
>                 return -1;
> --

Can you please fix the comment for this function as well?

 * @algo: requested hash algorithm

(should be @name)

Regards,
Simon
ChiaWei Wang Oct. 15, 2021, 1:34 a.m. UTC | #2
Hi Simon,

> From: Simon Glass <sjg@chromium.org>
> Sent: Thursday, October 14, 2021 11:10 PM
> 
> Hi Chia-Wei,
> 
> On Sun, 3 Oct 2021 at 19:54, Chia-Wei Wang
> <chiawei_wang@aspeedtech.com> wrote:
> >
> > Fix inconsistent function parameter name of the hash algorithm.
> >
> > Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
> > Fixes: 92055e138f2 ("image: Drop if/elseif hash selection in
> > calculate_hash()")
> > ---
> >  common/image-fit.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/common/image-fit.c b/common/image-fit.c index
> > 5a0a0cc200..9e8a1f36c1 100644
> > --- a/common/image-fit.c
> > +++ b/common/image-fit.c
> > @@ -1229,7 +1229,7 @@ int calculate_hash(const void *data, int data_len,
> const char *name,
> >                 return -1;
> >         }
> >
> > -       hash_algo = hash_algo_lookup_by_name(algo);
> > +       hash_algo = hash_algo_lookup_by_name(name);
> >         if (hash_algo == HASH_ALGO_INVALID) {
> >                 debug("Unsupported hash algorithm\n");
> >                 return -1;
> > --
> 
> Can you please fix the comment for this function as well?
> 
>  * @algo: requested hash algorithm
> 
> (should be @name)
> 

Sure. I missed the comment part.
Will send v6 to make them consistent ASAP.

Regards,
Chiawei
diff mbox series

Patch

diff --git a/common/image-fit.c b/common/image-fit.c
index 5a0a0cc200..9e8a1f36c1 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1229,7 +1229,7 @@  int calculate_hash(const void *data, int data_len, const char *name,
 		return -1;
 	}
 
-	hash_algo = hash_algo_lookup_by_name(algo);
+	hash_algo = hash_algo_lookup_by_name(name);
 	if (hash_algo == HASH_ALGO_INVALID) {
 		debug("Unsupported hash algorithm\n");
 		return -1;