From 7ebd578100e6526ef46c98cb9978d692160d8179 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Sat, 15 Jun 2019 15:44:39 +0200 Subject: layout: Add `capacity` field Use it to keep track of the size of the `entries` array. An interim solution until we have dynamic allocation. Change-Id: Ib5f431bc0a72a79a53fa1376c3417942b19dd3a0 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/flashrom/+/33516 Reviewed-by: Angel Pons Reviewed-by: Anastasia Klimchuk Reviewed-by: Peter Marheine Reviewed-by: Edward O'Callaghan Tested-by: build bot (Jenkins) --- ich_descriptors.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ich_descriptors.c') diff --git a/ich_descriptors.c b/ich_descriptors.c index 4ae3a1b8..143e3920 100644 --- a/ich_descriptors.c +++ b/ich_descriptors.c @@ -1295,6 +1295,7 @@ int layout_from_ich_descriptors(struct ich_layout *const layout, const void *con ++j; } layout->base.entries = layout->entries; + layout->base.capacity = ARRAY_SIZE(layout->entries); layout->base.num_entries = j; return 0; } -- cgit v1.2.3