David Hendricks has uploaded this change for review. ( https://review.coreboot.org/23343
Change subject: layout: Add a helper to get number of '-i' args with files ......................................................................
layout: Add a helper to get number of '-i' args with files
Change-Id: I2629167d371bc7f3766006600d2d256bed9ec145 Signed-off-by: David Hendricks dhendricks@fb.com --- M layout.c M layout.h 2 files changed, 14 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/43/23343/1
diff --git a/layout.c b/layout.c index a990adc..ebbb0a1 100644 --- a/layout.c +++ b/layout.c @@ -260,6 +260,19 @@ return overlap_detected; }
+/* return number of '-i' args with both region and filename specified */ +int get_num_include_args_with_files(const struct flashrom_layout *const l) +{ + int i, ret = 0; + + for (i = 0; i < l->num_entries; i++) { + if (l->entries[i].included && l->entries[i].file) + ret++; + } + + return ret; +} + void layout_cleanup(void) { int i; diff --git a/layout.h b/layout.h index f401ef2..9131b06 100644 --- a/layout.h +++ b/layout.h @@ -64,5 +64,6 @@
int process_include_args(struct flashrom_layout *); int included_regions_overlap(const struct flashrom_layout *const flashrom_layout); +int get_num_include_args_with_files(const struct flashrom_layout *const layout);
#endif /* !__LAYOUT_H__ */