Change in ...flashrom[master]: layout.c: Use the the libflashrom function for included arguments
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/31244 Change subject: layout.c: Use the the libflashrom function for included arguments ...................................................................... layout.c: Use the 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> --- M layout.c 1 file changed, 6 insertions(+), 11 deletions(-) git pull ssh://review.coreboot.org:29418/flashrom refs/changes/44/31244/1 diff --git a/layout.c b/layout.c index e10bb73..384a513 100644 --- a/layout.c +++ b/layout.c @@ -135,24 +135,19 @@ 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) { - int i; - if (l->num_entries == 0) return -1; msg_gspew("Looking for region \"%s\"... ", name); - for (i = 0; i < l->num_entries; i++) { - if (!strcmp(l->entries[i].name, name)) { - l->entries[i].included = 1; - msg_gspew("found.\n"); - return i; - } + if (flashrom_layout_include_region(l, name)) { + msg_gspew("not found.\n"); + return -1; } - msg_gspew("not found.\n"); - return -1; + msg_gspew("found.\n"); + return 0; } /* process -i arguments -- To view, visit https://review.coreboot.org/c/flashrom/+/31244 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I5e9375baad763612e179262973413a7161acba8b Gerrit-Change-Number: 31244 Gerrit-PatchSet: 1 Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz> Gerrit-MessageType: newchange
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/31244 ) Change subject: layout.c: Use the the libflashrom function for included arguments ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://review.coreboot.org/c/flashrom/+/31244 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I5e9375baad763612e179262973413a7161acba8b Gerrit-Change-Number: 31244 Gerrit-PatchSet: 1 Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-Comment-Date: Tue, 05 Feb 2019 17:25:29 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/31244 ) Change subject: layout.c: Use the the libflashrom function for included arguments ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://review.coreboot.org/c/flashrom/+/31244 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I5e9375baad763612e179262973413a7161acba8b Gerrit-Change-Number: 31244 Gerrit-PatchSet: 1 Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Nico Huber <nico.h@gmx.de> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-Comment-Date: Tue, 04 Jun 2019 15:30:35 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Nico Huber has uploaded a new patch set (#3) to the change originally created by Arthur Heymans. ( https://review.coreboot.org/c/flashrom/+/31244 ) Change subject: layout.c: Use the libflashrom function for included arguments ...................................................................... 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> --- M layout.c 1 file changed, 6 insertions(+), 11 deletions(-) git pull ssh://review.coreboot.org:29418/flashrom refs/changes/44/31244/3 -- To view, visit https://review.coreboot.org/c/flashrom/+/31244 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I5e9375baad763612e179262973413a7161acba8b Gerrit-Change-Number: 31244 Gerrit-PatchSet: 3 Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Nico Huber <nico.h@gmx.de> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-MessageType: newpatchset
Nico Huber has removed build bot (Jenkins) from this change. ( https://review.coreboot.org/c/flashrom/+/31244 ) Change subject: layout.c: Use the libflashrom function for included arguments ...................................................................... Removed reviewer build bot (Jenkins). -- To view, visit https://review.coreboot.org/c/flashrom/+/31244 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I5e9375baad763612e179262973413a7161acba8b Gerrit-Change-Number: 31244 Gerrit-PatchSet: 3 Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Nico Huber <nico.h@gmx.de> Gerrit-MessageType: deleteReviewer
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/31244 ) Change subject: layout.c: Use the libflashrom function for included arguments ...................................................................... Patch Set 3: Verified+1 Code-Review+2 -- To view, visit https://review.coreboot.org/c/flashrom/+/31244 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I5e9375baad763612e179262973413a7161acba8b Gerrit-Change-Number: 31244 Gerrit-PatchSet: 3 Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Nico Huber <nico.h@gmx.de> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-Comment-Date: Thu, 06 Jun 2019 16:17:56 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Nico Huber has submitted this change and it was merged. ( https://review.coreboot.org/c/flashrom/+/31244 ) Change subject: layout.c: Use the libflashrom function for included arguments ...................................................................... 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> --- M layout.c 1 file changed, 6 insertions(+), 11 deletions(-) Approvals: Nico Huber: Verified; Looks good to me, approved diff --git a/layout.c b/layout.c index 5080e3e..f757783 100644 --- a/layout.c +++ b/layout.c @@ -135,24 +135,19 @@ 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) { - int i; - if (l->num_entries == 0) return -1; msg_gspew("Looking for region \"%s\"... ", name); - for (i = 0; i < l->num_entries; i++) { - if (!strcmp(l->entries[i].name, name)) { - l->entries[i].included = 1; - msg_gspew("found.\n"); - return i; - } + if (flashrom_layout_include_region(l, name)) { + msg_gspew("not found.\n"); + return -1; } - msg_gspew("not found.\n"); - return -1; + msg_gspew("found.\n"); + return 0; } /* process -i arguments -- To view, visit https://review.coreboot.org/c/flashrom/+/31244 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I5e9375baad763612e179262973413a7161acba8b Gerrit-Change-Number: 31244 Gerrit-PatchSet: 4 Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Nico Huber <nico.h@gmx.de> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-MessageType: merged
participants (3)
-
Angel Pons (Code Review) -
Arthur Heymans (Code Review) -
Nico Huber (Code Review)