UPSTREAM: util/cbfstool: require -i argument for cbfstool add-int

We never specified what value add-int should write by default.

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/17796
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>

Change-Id: I240be4842fc374690c4a718fc4d8f0a03d63003c
Reviewed-on: https://chromium-review.googlesource.com/419637
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Patrick Georgi 2016-12-12 18:38:01 +01:00 committed by chrome-bot
commit 794f8b2290

View file

@ -70,6 +70,7 @@ static struct param {
uint32_t cbfsoffset;
uint32_t cbfsoffset_assigned;
uint32_t arch;
bool u64val_assigned;
bool fill_partial_upward;
bool fill_partial_downward;
bool show_immutable;
@ -717,6 +718,10 @@ static int cbfs_add_flat_binary(void)
static int cbfs_add_integer(void)
{
if (!param.u64val_assigned) {
ERROR("You need to specify a value to write.\n");
return 1;
}
return cbfs_add_integer_component(param.name,
param.u64val,
param.baseaddress,
@ -1463,6 +1468,7 @@ int main(int argc, char **argv)
break;
case 'i':
param.u64val = strtoull(optarg, &suffix, 0);
param.u64val_assigned = 1;
if (!*optarg || (suffix && *suffix)) {
ERROR("Invalid int parameter '%s'.\n",
optarg);