From dbe08c7b38f9bcb17c073cafc9ed8d3d2f398566 Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Tue, 24 Dec 2024 08:01:04 -0800 Subject: tpm: Rename tpm2_is_active_pcr() This function is checking for active PCR banks, so rename it to something that's easier to read and closer to what the function does. Signed-off-by: Raymond Mao Signed-off-by: Ilias Apalodimas --- lib/tpm-v2.c | 4 ++-- lib/tpm_tcg2.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/tpm-v2.c b/lib/tpm-v2.c index ad2b5ab0c32..cb636414de9 100644 --- a/lib/tpm-v2.c +++ b/lib/tpm-v2.c @@ -847,7 +847,7 @@ u32 tpm2_enable_nvcommits(struct udevice *dev, uint vendor_cmd, return 0; } -bool tpm2_is_active_pcr(struct tpms_pcr_selection *selection) +bool tpm2_is_active_bank(struct tpms_pcr_selection *selection) { int i; @@ -907,7 +907,7 @@ bool tpm2_allow_extend(struct udevice *dev) return false; for (i = 0; i < pcrs.count; i++) { - if (tpm2_is_active_pcr(&pcrs.selection[i]) && + if (tpm2_is_active_bank(&pcrs.selection[i]) && !tpm2_algorithm_to_len(pcrs.selection[i].hash)) return false; } diff --git a/lib/tpm_tcg2.c b/lib/tpm_tcg2.c index 7f868cc8837..edbe5f3aafa 100644 --- a/lib/tpm_tcg2.c +++ b/lib/tpm_tcg2.c @@ -43,7 +43,7 @@ int tcg2_get_pcr_info(struct udevice *dev, u32 *supported_pcr, u32 *active_pcr, if (hash_mask) { *supported_pcr |= hash_mask; - if (tpm2_is_active_pcr(&pcrs.selection[i])) + if (tpm2_is_active_bank(&pcrs.selection[i])) *active_pcr |= hash_mask; } else { printf("%s: unknown algorithm %x\n", __func__, -- cgit v1.2.3