From a434f48bbed4eee773fa3315cac6796859805e45 Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Sun, 30 Jul 2023 17:31:15 +0200 Subject: payloads/libpayload/include/coreboot_tables: 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: Icf3da1b0a0666769ae7b5d5f641b85436b324b4c Signed-off-by: Elyes Haouas Reviewed-on: https://review.coreboot.org/c/coreboot/+/76851 Reviewed-by: Felix Singer Tested-by: build bot (Jenkins) --- payloads/libpayload/include/coreboot_tables.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'payloads/libpayload') diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h index 5f6a223bca..4502e34484 100644 --- a/payloads/libpayload/include/coreboot_tables.h +++ b/payloads/libpayload/include/coreboot_tables.h @@ -125,7 +125,7 @@ struct cb_memory_range { struct cb_memory { u32 tag; u32 size; - struct cb_memory_range map[0]; + struct cb_memory_range map[]; }; struct cb_hwrpb { @@ -139,7 +139,7 @@ struct cb_mainboard { u32 size; u8 vendor_idx; u8 part_number_idx; - u8 strings[0]; + u8 strings[]; }; enum type_c_orientation { @@ -166,13 +166,13 @@ struct type_c_port_info { struct type_c_info { u32 port_count; - struct type_c_port_info port_info[0]; + struct type_c_port_info port_info[]; }; struct cb_string { u32 tag; u32 size; - u8 string[0]; + u8 string[]; }; struct cb_serial { @@ -255,7 +255,7 @@ struct cb_gpios { u32 size; u32 count; - struct cb_gpio gpios[0]; + struct cb_gpio gpios[]; }; struct cb_pcie { @@ -305,7 +305,7 @@ struct cb_spi_flash { * space and host address space. This determines the number of entries in mmap_table. */ uint32_t mmap_count; - struct flash_mmap_window mmap_table[0]; + struct flash_mmap_window mmap_table[]; }; struct cb_boot_media_params { @@ -344,7 +344,7 @@ struct cb_macs { uint32_t tag; uint32_t size; uint32_t count; - struct mac_address mac_addrs[0]; + struct mac_address mac_addrs[]; }; struct cb_mmc_info { -- cgit v1.2.3