summaryrefslogtreecommitdiffstats
path: root/ich_descriptors.c
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2019-06-15 15:44:39 +0200
committerNico Huber <nico.h@gmx.de>2021-06-26 15:53:31 +0000
commit7ebd578100e6526ef46c98cb9978d692160d8179 (patch)
treef87dc8068f97aa101ae4151dba40a9fd7dc77273 /ich_descriptors.c
parent06a89d713951a2e08ef8fb698a7688357baa83d1 (diff)
downloadflashrom-7ebd578100e6526ef46c98cb9978d692160d8179.tar.gz
flashrom-7ebd578100e6526ef46c98cb9978d692160d8179.tar.bz2
flashrom-7ebd578100e6526ef46c98cb9978d692160d8179.zip
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 <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/33516 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'ich_descriptors.c')
-rw-r--r--ich_descriptors.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ich_descriptors.c b/ich_descriptors.c
index 4ae3a1b87..143e39204 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;
}