Change in ...coreboot[master]: util/cbfstool/ifittool: used strtol function instead of atoi

Varshit B Pandya has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33937 Change subject: util/cbfstool/ifittool: used strtol function instead of atoi ...................................................................... util/cbfstool/ifittool: used strtol function instead of atoi atoi doesnot parse hex string, for instance 0x200 is interpreted as 0, and this causes a failure when updating second FIT table using -j option. Use strtol instead of atoi BUG=none BRANCH=none TEST=Build and boot hatch after enabling dual bootblock feature. Change-Id: Ib227437f88ffcccda1ce2f20a9ab098e5aa091c7 Signed-off-by: Pandya, Varshit B <varshit.b.pandya@intel.com> --- M util/cbfstool/ifittool.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/37/33937/1 diff --git a/util/cbfstool/ifittool.c b/util/cbfstool/ifittool.c index a83fd96..3b16c3f 100644 --- a/util/cbfstool/ifittool.c +++ b/util/cbfstool/ifittool.c @@ -28,7 +28,7 @@ /* Global variables */ partitioned_file_t *image_file; -static const char *optstring = "H:j:f:r:d:t:n:s:caDvh?"; +static const char *optstring = "H:j:f:r:d:t:n:s:cAaDvh?"; static struct option long_options[] = { {"file", required_argument, 0, 'f' }, {"region", required_argument, 0, 'r' }, @@ -230,7 +230,7 @@ } break; case 'j': - topswap_size = atoi(optarg); + topswap_size = strtol(optarg, NULL, 0); if (!is_valid_topswap(topswap_size)) return 1; break; -- To view, visit https://review.coreboot.org/c/coreboot/+/33937 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: Ib227437f88ffcccda1ce2f20a9ab098e5aa091c7 Gerrit-Change-Number: 33937 Gerrit-PatchSet: 1 Gerrit-Owner: Varshit B Pandya <varshit.b.pandya@intel.com> Gerrit-MessageType: newchange

Varshit B Pandya has uploaded a new patch set (#2). ( https://review.coreboot.org/c/coreboot/+/33937 ) Change subject: util/cbfstool/ifittool: use strtol function instead of atoi ...................................................................... util/cbfstool/ifittool: use strtol function instead of atoi atoi doesnot parse hex string, for instance 0x200 is interpreted as 0, and this causes a failure when updating second FIT table using -j option. Use strtol instead of atoi BUG=none BRANCH=none TEST=Build and boot hatch after enabling dual bootblock feature. Change-Id: Ib227437f88ffcccda1ce2f20a9ab098e5aa091c7 Signed-off-by: Pandya, Varshit B <varshit.b.pandya@intel.com> --- M util/cbfstool/ifittool.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/37/33937/2 -- To view, visit https://review.coreboot.org/c/coreboot/+/33937 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: Ib227437f88ffcccda1ce2f20a9ab098e5aa091c7 Gerrit-Change-Number: 33937 Gerrit-PatchSet: 2 Gerrit-Owner: Varshit B Pandya <varshit.b.pandya@intel.com> Gerrit-MessageType: newpatchset

Hello Subrata Banik, Patrick Rudolph, Rizwan Qureshi, build bot (Jenkins), I'd like you to reexamine a change. Please visit https://review.coreboot.org/c/coreboot/+/33937 to look at the new patch set (#3). Change subject: util/cbfstool/ifittool: use strtol function instead of atoi ...................................................................... util/cbfstool/ifittool: use strtol function instead of atoi Fix error "Invalid option -A" by adding "A" to options list. Also, atoi does not parse hex string, for instance 0x200 is interpreted as 0, and this causes a failure when updating second FIT table using -j option. Use strtol instead of atoi BUG=none BRANCH=none TEST=Build and boot hatch after enabling dual bootblock feature. Change-Id: Ib227437f88ffcccda1ce2f20a9ab098e5aa091c7 Signed-off-by: Pandya, Varshit B <varshit.b.pandya@intel.com> --- M util/cbfstool/ifittool.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/37/33937/3 -- To view, visit https://review.coreboot.org/c/coreboot/+/33937 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: Ib227437f88ffcccda1ce2f20a9ab098e5aa091c7 Gerrit-Change-Number: 33937 Gerrit-PatchSet: 3 Gerrit-Owner: Varshit B Pandya <varshit.b.pandya@intel.com> Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph@9elements.com> Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi@intel.com> Gerrit-Reviewer: Subrata Banik <subrata.banik@intel.com> Gerrit-Reviewer: Varshit B Pandya <varshit.b.pandya@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-MessageType: newpatchset

Rizwan Qureshi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33937 ) Change subject: util/cbfstool/ifittool: use strtol function instead of atoi ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://review.coreboot.org/c/coreboot/+/33937 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: Ib227437f88ffcccda1ce2f20a9ab098e5aa091c7 Gerrit-Change-Number: 33937 Gerrit-PatchSet: 3 Gerrit-Owner: Varshit B Pandya <varshit.b.pandya@intel.com> Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph@9elements.com> Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi@intel.com> Gerrit-Reviewer: Subrata Banik <subrata.banik@intel.com> Gerrit-Reviewer: Varshit B Pandya <varshit.b.pandya@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-Comment-Date: Mon, 01 Jul 2019 12:36:56 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment

Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33937 ) Change subject: util/cbfstool/ifittool: use strtol function instead of atoi ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://review.coreboot.org/c/coreboot/+/33937 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: Ib227437f88ffcccda1ce2f20a9ab098e5aa091c7 Gerrit-Change-Number: 33937 Gerrit-PatchSet: 3 Gerrit-Owner: Varshit B Pandya <varshit.b.pandya@intel.com> Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph@9elements.com> Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi@intel.com> Gerrit-Reviewer: Subrata Banik <subrata.banik@intel.com> Gerrit-Reviewer: Varshit B Pandya <varshit.b.pandya@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-Comment-Date: Mon, 01 Jul 2019 12:50:03 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment

Philipp Deppenwiese has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/33937 ) Change subject: util/cbfstool/ifittool: use strtol function instead of atoi ...................................................................... util/cbfstool/ifittool: use strtol function instead of atoi Fix error "Invalid option -A" by adding "A" to options list. Also, atoi does not parse hex string, for instance 0x200 is interpreted as 0, and this causes a failure when updating second FIT table using -j option. Use strtol instead of atoi BUG=none BRANCH=none TEST=Build and boot hatch after enabling dual bootblock feature. Change-Id: Ib227437f88ffcccda1ce2f20a9ab098e5aa091c7 Signed-off-by: Pandya, Varshit B <varshit.b.pandya@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/33937 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Rizwan Qureshi <rizwan.qureshi@intel.com> Reviewed-by: Subrata Banik <subrata.banik@intel.com> --- M util/cbfstool/ifittool.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: build bot (Jenkins): Verified Rizwan Qureshi: Looks good to me, approved Subrata Banik: Looks good to me, approved diff --git a/util/cbfstool/ifittool.c b/util/cbfstool/ifittool.c index a83fd96..3b16c3f 100644 --- a/util/cbfstool/ifittool.c +++ b/util/cbfstool/ifittool.c @@ -28,7 +28,7 @@ /* Global variables */ partitioned_file_t *image_file; -static const char *optstring = "H:j:f:r:d:t:n:s:caDvh?"; +static const char *optstring = "H:j:f:r:d:t:n:s:cAaDvh?"; static struct option long_options[] = { {"file", required_argument, 0, 'f' }, {"region", required_argument, 0, 'r' }, @@ -230,7 +230,7 @@ } break; case 'j': - topswap_size = atoi(optarg); + topswap_size = strtol(optarg, NULL, 0); if (!is_valid_topswap(topswap_size)) return 1; break; -- To view, visit https://review.coreboot.org/c/coreboot/+/33937 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: Ib227437f88ffcccda1ce2f20a9ab098e5aa091c7 Gerrit-Change-Number: 33937 Gerrit-PatchSet: 5 Gerrit-Owner: Varshit B Pandya <varshit.b.pandya@intel.com> Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph@9elements.com> Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki@gmail.com> Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi@intel.com> Gerrit-Reviewer: Subrata Banik <subrata.banik@intel.com> Gerrit-Reviewer: Varshit B Pandya <varshit.b.pandya@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net> Gerrit-MessageType: merged
participants (4)
-
Philipp Deppenwiese (Code Review)
-
Rizwan Qureshi (Code Review)
-
Subrata Banik (Code Review)
-
Varshit B Pandya (Code Review)