Attention is currently required from: Zheng Bao.
Hello Zheng Bao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/81929?usp=email
to review the following change.
Change subject: amdfwtool: Print usage only once & Return zero for printing usage ......................................................................
amdfwtool: Print usage only once & Return zero for printing usage
Change-Id: Ie377c65147f6a72955e840fcf60001224e9e6f84 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M util/amdfwtool/amdfwtool.c M util/amdfwtool/amdfwtool.h M util/amdfwtool/opts.c 3 files changed, 6 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/29/81929/1
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 900dc56..97ff9db 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -1610,7 +1610,7 @@
retval = amdfwtool_getopt(argc, argv, &cb_config, &ctx);
- if (retval) { + if (retval || cb_config.usage_only) { return retval; }
diff --git a/util/amdfwtool/amdfwtool.h b/util/amdfwtool/amdfwtool.h index 1dc445c..16daa98 100644 --- a/util/amdfwtool/amdfwtool.h +++ b/util/amdfwtool/amdfwtool.h @@ -413,6 +413,8 @@ } __packed;
typedef struct _amd_cb_config { + bool usage_only; + bool have_whitelist; bool unlock_secure; bool use_secureos; diff --git a/util/amdfwtool/opts.c b/util/amdfwtool/opts.c index 511ffd0..7fa31c5c 100644 --- a/util/amdfwtool/opts.c +++ b/util/amdfwtool/opts.c @@ -585,7 +585,9 @@ break; case AMDFW_OPT_HELP: usage(); - retval = 1; + cb_config->usage_only = 1; + retval = 0; + return retval; break; case AMDFW_OPT_BODY_LOCATION: cb_config->body_location = (uint32_t)strtoul(optarg, &tmp, 16);