Jakub Czapiga has submitted this change. ( https://review.coreboot.org/c/coreboot/+/76843?usp=email )
Change subject: security/intel/stm/StmApi.h: Use C99 flexible arrays ......................................................................
security/intel/stm/StmApi.h: Use C99 flexible arrays
Use C99 flexible arrays instead of older style of one-element or zero-length arrays. It allows the compiler to generate errors when the flexible array does not occur at the end in the structure.
Change-Id: I3ab3538b276fee5ed135bb4e88d9ef2cd6a00bb9 Signed-off-by: Elyes Haouas ehaouas@noos.fr Reviewed-on: https://review.coreboot.org/c/coreboot/+/76843 Reviewed-by: Felix Singer service+coreboot-gerrit@felixsinger.de Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/security/intel/stm/StmApi.h 1 file changed, 4 insertions(+), 4 deletions(-)
Approvals: build bot (Jenkins): Verified Felix Singer: Looks good to me, approved
diff --git a/src/security/intel/stm/StmApi.h b/src/security/intel/stm/StmApi.h index af57341..1a594a7 100644 --- a/src/security/intel/stm/StmApi.h +++ b/src/security/intel/stm/StmApi.h @@ -42,7 +42,7 @@ uint32_t additional_dynamic_memory_size; STM_FEAT stm_features; uint32_t number_of_rev_ids; - uint32_t stm_smm_rev_id[1]; + uint32_t stm_smm_rev_id[];
// The total STM_HEADER should be 4K. } SOFTWARE_STM_HEADER; @@ -65,7 +65,7 @@ typedef struct { uint32_t image_size; uint32_t reserved; - uint64_t image_page_base[1]; //[NumberOfPages]; + uint64_t image_page_base[]; //[NumberOfPages]; } TXT_BIOS_COMPONENT_UPDATE;
typedef struct { @@ -413,7 +413,7 @@ uint16_t length; uint8_t originating_bus_number; uint8_t last_node_index; - STM_PCI_DEVICE_PATH_NODE pci_device_path[1]; + STM_PCI_DEVICE_PATH_NODE pci_device_path[]; // STM_PCI_DEVICE_PATH_NODE PciDevicePath[LastNodeIndex + 1]; } STM_RSC_PCI_CFG_DESC;
@@ -524,7 +524,7 @@
typedef struct { uint32_t page_count; - uint64_t pages[1]; // number of elements is PageCount + uint64_t pages[]; // number of elements is PageCount } STM_EVENT_LOG_MANAGEMENT_REQUEST_DATA_LOG_BUFFER;
typedef union {