From 8c0168ab86310eca6f78ba8bcbdf13397951c63e Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Fri, 28 Jul 2023 06:19:21 +0200 Subject: commonlib/coreboot_tables.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: I495605190b2c6cd11c7f78727ab4611e10b4d9d3 Signed-off-by: Elyes Haouas Reviewed-on: https://review.coreboot.org/c/coreboot/+/76785 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans --- src/commonlib/include/commonlib/coreboot_tables.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/commonlib') diff --git a/src/commonlib/include/commonlib/coreboot_tables.h b/src/commonlib/include/commonlib/coreboot_tables.h index e646b8bf53a8..e3e9468b1cca 100644 --- a/src/commonlib/include/commonlib/coreboot_tables.h +++ b/src/commonlib/include/commonlib/coreboot_tables.h @@ -146,7 +146,7 @@ struct lb_memory_range { struct lb_memory { uint32_t tag; uint32_t size; - struct lb_memory_range map[0]; + struct lb_memory_range map[]; }; struct lb_pcie { @@ -168,13 +168,13 @@ struct lb_mainboard { uint32_t size; uint8_t vendor_idx; uint8_t part_number_idx; - uint8_t strings[0]; + uint8_t strings[]; }; struct lb_string { uint32_t tag; uint32_t size; - uint8_t string[0]; + uint8_t string[]; }; struct lb_timestamp { @@ -311,7 +311,7 @@ struct lb_gpios { uint32_t size; uint32_t count; - struct lb_gpio gpios[0]; + struct lb_gpio gpios[]; }; struct lb_range { @@ -357,7 +357,7 @@ struct lb_spi_flash { */ uint32_t mmap_count; - struct flash_mmap_window mmap_table[0]; + struct flash_mmap_window mmap_table[]; }; struct lb_boot_media_params { @@ -432,14 +432,14 @@ struct type_c_port_info { struct type_c_info { uint32_t port_count; - struct type_c_port_info port_info[0]; + struct type_c_port_info port_info[]; }; struct lb_macs { uint32_t tag; uint32_t size; uint32_t count; - struct mac_address mac_addrs[0]; + struct mac_address mac_addrs[]; }; struct lb_board_config { -- cgit v1.2.3