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 <benjamin.doron@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87869
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Reviewed-by: Alicja Michalska <ahplka19@gmail.com>
This commit is contained in:
Benjamin Doron 2025-05-27 12:30:07 -04:00 committed by Matt DeVillier
commit 0251e98e9e

View file

@ -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') {