On 30.05.2025 15:17, Sergii Dmytruk wrote:
> @@ -769,19 +807,11 @@ static uint32_t tpm2_hash_extend(unsigned loc, const 
> uint8_t *buf,
>          }
>  
>          if ( hash->alg == TPM_ALG_SHA1 )
> -        {
>              sha1_hash(hash->data, buf, size);
> -        }
>          else if ( hash->alg == TPM_ALG_SHA256 )
> -        {
>              sha2_256_digest(hash->data, buf, size);
> -        }
>          else

Please omit the braces then right when introducing the code.

> @@ -832,26 +958,15 @@ void tpm_hash_extend(unsigned loc, unsigned pcr, const 
> uint8_t *buf,
>              printk(XENLOG_ERR "Extending PCR%u failed\n", pcr);
>  #endif
>          }
> -    } else {
> -        uint8_t sha1_digest[SHA1_DIGEST_SIZE];
> -        uint8_t sha256_digest[SHA2_256_DIGEST_SIZE];
> +    }
> +    else
> +    {

Similarly here - please get the style right when the code is first added.

Jan

Reply via email to