1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 15:12:36 +02:00

layout.c: Use the libflashrom function for included arguments

Use the libflashrom function to determine whether included regions are
present in the layout file.

Change-Id: I5e9375baad763612e179262973413a7161acba8b
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/31244
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Arthur Heymans 2019-02-05 16:14:55 +01:00 committed by Nico Huber
parent 2e50cdc494
commit 32b9f5c665

View File

@ -135,24 +135,19 @@ int register_include_arg(char *name)
return 0; return 0;
} }
/* returns the index of the entry (or a negative value if it is not found) */ /* returns -1 if an entry is not found, 0 if found. */
static int find_romentry(struct flashrom_layout *const l, char *name) static int find_romentry(struct flashrom_layout *const l, char *name)
{ {
int i;
if (l->num_entries == 0) if (l->num_entries == 0)
return -1; return -1;
msg_gspew("Looking for region \"%s\"... ", name); msg_gspew("Looking for region \"%s\"... ", name);
for (i = 0; i < l->num_entries; i++) { if (flashrom_layout_include_region(l, name)) {
if (!strcmp(l->entries[i].name, name)) { msg_gspew("not found.\n");
l->entries[i].included = 1; return -1;
msg_gspew("found.\n");
return i;
}
} }
msg_gspew("not found.\n"); msg_gspew("found.\n");
return -1; return 0;
} }
/* process -i arguments /* process -i arguments