Jakub Czapiga has submitted this change. ( https://review.coreboot.org/c/coreboot/+/76813?usp=email )
Change subject: include/acpi: Use C99 flexible arrays ......................................................................
include/acpi: 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: I3d5838b825c6ac2a2959388381004993024081c3 Signed-off-by: Elyes Haouas ehaouas@noos.fr Reviewed-on: https://review.coreboot.org/c/coreboot/+/76813 Reviewed-by: Felix Singer service+coreboot-gerrit@felixsinger.de Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/include/acpi/acpi.h M src/include/acpi/acpi_ivrs.h 2 files changed, 6 insertions(+), 6 deletions(-)
Approvals: build bot (Jenkins): Verified Felix Singer: Looks good to me, approved
diff --git a/src/include/acpi/acpi.h b/src/include/acpi/acpi.h index f1c52d1..0aa8026 100644 --- a/src/include/acpi/acpi.h +++ b/src/include/acpi/acpi.h @@ -506,7 +506,7 @@ uint16_t pci_segment_group; uint16_t iommu_info; uint32_t iommu_feature_info; - uint8_t entry[0]; + uint8_t entry[]; } __packed acpi_ivrs_ivhd_t;
/* IVRS (I/O Virtualization Reporting Structure) Type 10h */ @@ -549,7 +549,7 @@ uint32_t efr_reg_image_low; uint32_t efr_reg_image_high; uint32_t reserved[2]; - uint8_t entry[0]; + uint8_t entry[]; } __packed acpi_ivrs_ivhd11_t;
enum dev_scope_type { @@ -569,7 +569,7 @@ struct { u8 dev; u8 fn; - } __packed path[0]; + } __packed path[]; } __packed dev_scope_t;
enum dmar_type { @@ -651,7 +651,7 @@ u8 host_address_width; u8 flags; u8 reserved[10]; - dmar_entry_t structure[0]; + dmar_entry_t structure[]; } __packed acpi_dmar_t;
/* MADT: APIC Structure Types */ @@ -1246,7 +1246,7 @@ u32 revision; u32 table_size; u32 entry_count; - acpi_einj_action_table_t trigger_action[1]; + acpi_einj_action_table_t trigger_action[]; } __packed acpi_einj_trigger_table_t;
typedef struct set_error_type { diff --git a/src/include/acpi/acpi_ivrs.h b/src/include/acpi/acpi_ivrs.h index fe0aa40..ad86e6a 100644 --- a/src/include/acpi/acpi_ivrs.h +++ b/src/include/acpi/acpi_ivrs.h @@ -201,7 +201,7 @@ uint32_t efr_reg_image_low; uint32_t efr_reg_image_high; uint32_t reserved[2]; - uint8_t entry[0]; + uint8_t entry[]; } __packed acpi_ivrs_ivhd40_t;
typedef struct ivrs_ivhd_extended {