From a3e54ddf4914853e6ba93e7a59da69609e7072d3 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 27 Jun 2023 18:46:07 +0200 Subject: [PATCH] tpm2: make PcrIndex an anonymous enum It just gives names for things generally just handled as numeric indexes, hence drop the type name, and make the enum anonymous. Nothing is using the type name anyway. --- src/shared/tpm2-util.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/shared/tpm2-util.h b/src/shared/tpm2-util.h index 5fa64563796..953e936c75f 100644 --- a/src/shared/tpm2-util.h +++ b/src/shared/tpm2-util.h @@ -181,17 +181,19 @@ typedef enum Tpm2Support { TPM2_SUPPORT_FULL = TPM2_SUPPORT_FIRMWARE|TPM2_SUPPORT_DRIVER|TPM2_SUPPORT_SYSTEM|TPM2_SUPPORT_SUBSYSTEM, } Tpm2Support; -typedef enum PcrIndex { -/* The following names for PCRs 0…7 are based on the names in the "TCG PC Client Specific Platform Firmware Profile Specification" (https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/) */ - PCR_PLATFORM_CODE = 0, +enum { + /* The following names for PCRs 0…7 are based on the names in the "TCG PC Client Specific Platform + * Firmware Profile Specification" + * (https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/) */ + PCR_PLATFORM_CODE = 0, PCR_PLATFORM_CONFIG = 1, PCR_EXTERNAL_CODE = 2, PCR_EXTERNAL_CONFIG = 3, PCR_BOOT_LOADER_CODE = 4, PCR_BOOT_LOADER_CONFIG = 5, PCR_SECURE_BOOT_POLICY = 7, -/* The following names for PCRs 9…15 are based on the "Linux TPM PCR Registry" -(https://uapi-group.org/specifications/specs/linux_tpm_pcr_registry/) */ + /* The following names for PCRs 9…15 are based on the "Linux TPM PCR Registry" + (https://uapi-group.org/specifications/specs/linux_tpm_pcr_registry/) */ PCR_KERNEL_INITRD = 9, PCR_IMA = 10, PCR_KERNEL_BOOT = 11, @@ -199,12 +201,12 @@ typedef enum PcrIndex { PCR_SYSEXTS = 13, PCR_SHIM_POLICY = 14, PCR_SYSTEM_IDENTITY = 15, -/* As per "TCG PC Client Specific Platform Firmware Profile Specification" again, see above */ + /* As per "TCG PC Client Specific Platform Firmware Profile Specification" again, see above */ PCR_DEBUG = 16, PCR_APPLICATION_SUPPORT = 23, _PCR_INDEX_MAX_DEFINED = TPM2_PCRS_MAX, _PCR_INDEX_INVALID = -EINVAL, -} PcrIndex; +}; Tpm2Support tpm2_support(void); -- 2.47.3