lkml.org 
[lkml]   [2023]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 1/3] security: keys: don't use data type as variable name
Date
'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@HansenPartnership.com
CC: jarkko@kernel.org
Fixes: f2219745250f ("security: keys: trusted: use ASN.1 TPM2 key format for the blobs")
Signed-off-by: Wei Wang <wei.w.wang@intel.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
\
 
 \ /
  Last update: 2023-03-27 00:44    [W:0.062 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site