util/cbfstool: require -i argument for cbfstool add-int
We never specified what value add-int should write by default. Change-Id: I240be4842fc374690c4a718fc4d8f0a03d63003c 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>
This commit is contained in:
parent
ffc934d944
commit
16b3e4bd2c
|
@ -70,6 +70,7 @@ static struct param {
|
||||||
uint32_t cbfsoffset;
|
uint32_t cbfsoffset;
|
||||||
uint32_t cbfsoffset_assigned;
|
uint32_t cbfsoffset_assigned;
|
||||||
uint32_t arch;
|
uint32_t arch;
|
||||||
|
bool u64val_assigned;
|
||||||
bool fill_partial_upward;
|
bool fill_partial_upward;
|
||||||
bool fill_partial_downward;
|
bool fill_partial_downward;
|
||||||
bool show_immutable;
|
bool show_immutable;
|
||||||
|
@ -716,6 +717,10 @@ static int cbfs_add_flat_binary(void)
|
||||||
|
|
||||||
static int cbfs_add_integer(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,
|
return cbfs_add_integer_component(param.name,
|
||||||
param.u64val,
|
param.u64val,
|
||||||
param.baseaddress,
|
param.baseaddress,
|
||||||
|
@ -1452,6 +1457,7 @@ int main(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
param.u64val = strtoull(optarg, &suffix, 0);
|
param.u64val = strtoull(optarg, &suffix, 0);
|
||||||
|
param.u64val_assigned = 1;
|
||||||
if (!*optarg || (suffix && *suffix)) {
|
if (!*optarg || (suffix && *suffix)) {
|
||||||
ERROR("Invalid int parameter '%s'.\n",
|
ERROR("Invalid int parameter '%s'.\n",
|
||||||
optarg);
|
optarg);
|
||||||
|
|
Loading…
Reference in New Issue