From 0251e98e9e1dd4aae898725b060ee06693a20930 Mon Sep 17 00:00:00 2001 From: Benjamin Doron Date: Tue, 27 May 2025 12:30:07 -0400 Subject: [PATCH] util/amdfwtool: Do not attempt to continue processing `--help` If the `--help` argument is passed, print the usage and immediately return. This avoids printing errors about 'invalid config,' which users don't specify when getting the usage information, and potentially printing the usage a second time before exiting. Change-Id: I18bf154ff5177fa0e0aa6a41f0d71980fed7ce55 Signed-off-by: Benjamin Doron Reviewed-on: https://review.coreboot.org/c/coreboot/+/87869 Tested-by: build bot (Jenkins) Reviewed-by: Maximilian Brune Reviewed-by: Alicja Michalska --- util/amdfwtool/opts.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/amdfwtool/opts.c b/util/amdfwtool/opts.c index 15bc7ca3a5..158eb656aa 100644 --- a/util/amdfwtool/opts.c +++ b/util/amdfwtool/opts.c @@ -601,8 +601,7 @@ int amdfwtool_getopt(int argc, char *argv[], amd_cb_config *cb_config, context * break; case AMDFW_OPT_HELP: usage(); - retval = 1; - break; + return 1; case AMDFW_OPT_BODY_LOCATION: cb_config->body_location = (uint32_t)strtoul(optarg, &tmp, 16); if (*tmp != '\0') {