diff options
author | Nico Huber <nico.h@gmx.de> | 2019-06-15 22:29:08 +0200 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2019-06-17 08:33:09 +0000 |
commit | 5ca5523fd8f6800c32cbc8f3724b393e791cebd6 (patch) | |
tree | f68209e48c9c54006a5af5c09e6d0b5d4ad1c9d9 /layout.c | |
parent | 70461a9524fc84ec5c095f11927cffa0429a6267 (diff) | |
download | flashrom-git-5ca5523fd8f6800c32cbc8f3724b393e791cebd6.tar.gz |
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>
Diffstat (limited to 'layout.c')
-rw-r--r-- | layout.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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 * @{ |