From 5532a721f5cde7b1ac7b80a44e1ccbec2bb43d23 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 8 Mar 2026 17:54:26 +0000 Subject: util/nvmutil: clean up some code Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 212e1a3e..c5bd2d6d 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -216,6 +216,7 @@ struct commands { uint8_t set_modified; /* both, one part, both or neither */ /* affected by invert */ uint8_t arg_part; /* 0: no part given. 1: part given */ + /* if set, only the user-specified part is read */ }; /* @@ -474,20 +475,22 @@ set_cmd_args(int argc, char *argv[]) mac_str = rmac; } - /* - * This will never actually run. - * It's put here as a guard against - * future regressions by maintainers. - * - * The reason this shouldn't run is - * because when a bad command (or no - * command) is given, either the command - * should be treated as a MAC address, - * or if no command is given, a random - * MAC address is used. - */ - if (!valid_command(cmd_index)) { + /* + * This should never actually run. + * It's put here as a guard against + * future regressions by maintainers. + * + * The reason this shouldn't run is + * because when a bad command (or no + * command) is given, either the command + * should be treated as a MAC address, + * or if no command is given, a random + * MAC address is used. + * + * Therefore, a valid command should + * always exist at this point. + */ usage(0); err(EINVAL, "Unhandled command error"); } -- cgit v1.2.1