diff mbox series

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

Message ID 20211020024933.16964-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. 20, 2021, 2:49 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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Joel Stanley Oct. 21, 2021, 12:08 a.m. UTC | #1
On Wed, 20 Oct 2021 at 02:49, 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()")

Reviewed-by: Joel Stanley <joel@jms.id.au>

This fix should go in independent of your series.


> ---
>  common/image-fit.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/common/image-fit.c b/common/image-fit.c
> index 5a0a0cc200..a53a2b5d6f 100644
> --- a/common/image-fit.c
> +++ b/common/image-fit.c
> @@ -1201,7 +1201,7 @@ int fit_set_timestamp(void *fit, int noffset, time_t timestamp)
>   * calculate_hash - calculate and return hash for provided input data
>   * @data: pointer to the input data
>   * @data_len: data length
> - * @algo: requested hash algorithm
> + * @name: requested hash algorithm name
>   * @value: pointer to the char, will hold hash value data (caller must
>   * allocate enough free space)
>   * value_len: length of the calculated hash
> @@ -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;
> --
> 2.17.1
>
ChiaWei Wang Oct. 21, 2021, 2:23 a.m. UTC | #2
> From: Joel Stanley <joel@jms.id.au>
> Sent: Thursday, October 21, 2021 8:08 AM
> 
> On Wed, 20 Oct 2021 at 02:49, 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()")
> 
> Reviewed-by: Joel Stanley <joel@jms.id.au>
> 
> This fix should go in independent of your series.

The fix is included to solve the compilation failure of this patch series.

Regards,
Chiawei
Simon Glass Oct. 24, 2021, 7:53 p.m. UTC | #3
On Wed, 20 Oct 2021 at 20:23, ChiaWei Wang <chiawei_wang@aspeedtech.com> wrote:
>
> > From: Joel Stanley <joel@jms.id.au>
> > Sent: Thursday, October 21, 2021 8:08 AM
> >
> > On Wed, 20 Oct 2021 at 02:49, 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()")
> >
> > Reviewed-by: Joel Stanley <joel@jms.id.au>
> >
> > This fix should go in independent of your series.
>
> The fix is included to solve the compilation failure of this patch series.
>

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/common/image-fit.c b/common/image-fit.c
index 5a0a0cc200..a53a2b5d6f 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1201,7 +1201,7 @@  int fit_set_timestamp(void *fit, int noffset, time_t timestamp)
  * calculate_hash - calculate and return hash for provided input data
  * @data: pointer to the input data
  * @data_len: data length
- * @algo: requested hash algorithm
+ * @name: requested hash algorithm name
  * @value: pointer to the char, will hold hash value data (caller must
  * allocate enough free space)
  * value_len: length of the calculated hash
@@ -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;