diff options
author | Elyes Haouas <ehaouas@noos.fr> | 2023-07-30 17:31:15 +0200 |
---|---|---|
committer | Jakub Czapiga <jacz@semihalf.com> | 2023-08-01 12:35:34 +0000 |
commit | a434f48bbed4eee773fa3315cac6796859805e45 (patch) | |
tree | 3d385dcaab1340b8cd2c4a756951dd16da1c7028 /payloads/libpayload/include | |
parent | 63c952a66cf7ea9352307faf0b9c4adce1193735 (diff) |
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 <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76851
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'payloads/libpayload/include')
-rw-r--r-- | payloads/libpayload/include/coreboot_tables.h | 14 |
1 files changed, 7 insertions, 7 deletions
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 { |