1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 14:11:15 +02:00

layout: Introduce layout_next_included()

Change-Id: Ib01c8af06c3f84eafbd585760e74c3c287b9fa7d
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/33518
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Nico Huber
2019-06-15 22:29:08 +02:00
parent 70461a9524
commit 5ca5523fd8
3 changed files with 31 additions and 21 deletions

View File

@ -252,6 +252,24 @@ const struct romentry *layout_next_included_region(
return lowest;
}
const struct romentry *layout_next_included(
const struct flashrom_layout *const layout, const struct romentry *iterator)
{
const struct romentry *const end = layout->entries + layout->num_entries;
if (iterator)
++iterator;
else
iterator = &layout->entries[0];
for (; iterator < end; ++iterator) {
if (!iterator->included)
continue;
return iterator;
}
return NULL;
}
/**
* @addtogroup flashrom-layout
* @{