summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2023-07-28 06:19:21 +0200
committerElyes Haouas <ehaouas@noos.fr>2023-07-30 09:58:46 +0000
commit8c0168ab86310eca6f78ba8bcbdf13397951c63e (patch)
tree046e73cd5b90bb01bd8bdb193e58a02e81bd99c6
parent19b534d5fd0595393a6e88d8c7a0eee8b17feda1 (diff)
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 <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/76785 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
-rw-r--r--src/commonlib/include/commonlib/coreboot_tables.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/commonlib/include/commonlib/coreboot_tables.h b/src/commonlib/include/commonlib/coreboot_tables.h
index e646b8bf53..e3e9468b1c 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 {