[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZAz9Gi/nHL8TLrRn@kernel.org>
Date: Sun, 12 Mar 2023 00:13:46 +0200
From: Jarkko Sakkinen <jarkko@...nel.org>
To: Wei Wang <wei.w.wang@...el.com>
Cc: arnd@...db.de, akpm@...ux-foundation.org, keescook@...omium.org,
herbert@...dor.apana.org.au, josh@...htriplett.org,
jani.nikula@...el.com, corbet@....net, jgg@...lanox.com,
dmatlack@...gle.com, mizhang@...gle.com, pbonzini@...hat.com,
seanjc@...gle.com, linux-kernel@...r.kernel.org,
James.Bottomley@...senpartnership.com
Subject: Re: [PATCH v1 1/3] security: keys: don't use data type as variable
name
On Sat, Mar 04, 2023 at 12:19:30PM +0800, Wei Wang wrote:
> 'bool' is a specific name for the data type that is an alias for
> the C99 _Bool type. It shoudn't be used as variable names as that causes
> too much confusion either for the reader or the compilier.
>
> CC: James.Bottomley@...senPartnership.com
> CC: jarkko@...nel.org
> Fixes: f2219745250f ("security: keys: trusted: use ASN.1 TPM2 key format for the blobs")
> Signed-off-by: Wei Wang <wei.w.wang@...el.com>
> ---
> security/keys/trusted-keys/trusted_tpm2.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/security/keys/trusted-keys/trusted_tpm2.c b/security/keys/trusted-keys/trusted_tpm2.c
> index 2b2c8eb258d5..390d7314f5a6 100644
> --- a/security/keys/trusted-keys/trusted_tpm2.c
> +++ b/security/keys/trusted-keys/trusted_tpm2.c
> @@ -54,12 +54,13 @@ static int tpm2_key_encode(struct trusted_key_payload *payload,
> asn1_oid_len(tpm2key_oid));
>
> if (options->blobauth_len == 0) {
> - unsigned char bool[3], *w = bool;
> + unsigned char bool_val[3], *w = bool_val;
> /* tag 0 is emptyAuth */
> w = asn1_encode_boolean(w, w + sizeof(bool), true);
> if (WARN(IS_ERR(w), "BUG: Boolean failed to encode"))
> return PTR_ERR(w);
> - work = asn1_encode_tag(work, end_work, 0, bool, w - bool);
> + work = asn1_encode_tag(work, end_work, 0,
> + bool_val, w - bool_val);
> }
>
> /*
> --
> 2.27.0
>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@...nel.org>
BR, Jarkko
Powered by blists - more mailing lists