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:
18
layout.c
18
layout.c
@ -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
|
||||
* @{
|
||||
|
Reference in New Issue
Block a user