[PATCH 02/11] tpm: Rename tpm2_is_active_pcr()
Raymond Mao
raymond.mao at linaro.org
Mon Dec 23 15:47:24 CET 2024
From: Ilias Apalodimas <ilias.apalodimas at linaro.org>
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: Ilias Apalodimas <ilias.apalodimas at linaro.org>
Signed-off-by: Raymond Mao <raymond.mao at linaro.org>
---
include/tpm-v2.h | 6 +++---
lib/tpm-v2.c | 4 ++--
lib/tpm_tcg2.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/tpm-v2.h b/include/tpm-v2.h
index 4fd19c52fd..8c43f4fd9b 100644
--- a/include/tpm-v2.h
+++ b/include/tpm-v2.h
@@ -740,12 +740,12 @@ u16 tpm2_algorithm_to_len(enum tpm2_algorithms algo);
bool tpm2_allow_extend(struct udevice *dev);
/**
- * tpm2_is_active_pcr() - check the pcr_select. If at least one of the PCRs
- * supports the algorithm add it on the active ones
+ * tpm2_is_active_bank() - check the pcr_select. If at least one of the PCRs
+ * supports the algorithm add it on the active ones
*
* @selection: PCR selection structure
* Return: True if the algorithm is active
*/
-bool tpm2_is_active_pcr(struct tpms_pcr_selection *selection);
+bool tpm2_is_active_bank(struct tpms_pcr_selection *selection);
#endif /* __TPM_V2_H */
diff --git a/lib/tpm-v2.c b/lib/tpm-v2.c
index ad2b5ab0c3..cb636414de 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 acaf0acb88..dc5a0644fd 100644
--- a/lib/tpm_tcg2.c
+++ b/lib/tpm_tcg2.c
@@ -44,7 +44,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__,
--
2.25.1
More information about the U-Boot
mailing list