From: Lennart Poettering Date: Tue, 3 Jun 2025 14:11:35 +0000 (+0200) Subject: tpm2-util: use BIT_FOREACH() more X-Git-Tag: v258-rc1~408^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8756482804b53e4fc8ead270843da4856e9dce82;p=thirdparty%2Fsystemd.git tpm2-util: use BIT_FOREACH() more --- diff --git a/src/shared/tpm2-util.c b/src/shared/tpm2-util.c index 6a6756c990d..e7bc86faa12 100644 --- a/src/shared/tpm2-util.c +++ b/src/shared/tpm2-util.c @@ -6671,14 +6671,11 @@ int tpm2_calculate_policy_super_pcr( /* First we look for all PCRs that have exactly one allowed hash value, and generate a single PolicyPCR policy from them */ _cleanup_free_ Tpm2PCRValue *single_values = NULL; size_t n_single_values = 0; - for (uint32_t pcr = 0; pcr < TPM2_PCRS_MAX; pcr++) { - if (!BIT_SET(prediction->pcrs, pcr)) - continue; - + BIT_FOREACH(pcr, prediction->pcrs) { if (ordered_set_size(prediction->results[pcr]) != 1) continue; - log_debug("Including PCR %" PRIu32 " in single value PolicyPCR expression", pcr); + log_debug("Including PCR %i in single value PolicyPCR expression", pcr); Tpm2PCRPredictionResult *banks = ASSERT_PTR(ordered_set_first(prediction->results[pcr]));