Commit d7ada245 authored by zwelch's avatar zwelch
Browse files

Simplify and fix handle_reset_command:

- Return syntax error if more than one argument is given.
- Move variables to location of first use.

git-svn-id: svn:// b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent e4850d71
......@@ -1912,11 +1912,13 @@ static int handle_soft_reset_halt_command(struct command_context_s *cmd_ctx, cha
static int handle_reset_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
const Jim_Nvp *n;
enum target_reset_mode reset_mode = RESET_RUN;
if (argc > 1)
if (argc >= 1)
enum target_reset_mode reset_mode = RESET_RUN;
if (argc == 1)
const Jim_Nvp *n;
n = Jim_Nvp_name2value_simple( nvp_reset_modes, args[0] );
if( (n->name == NULL) || (n->value == RESET_UNKNOWN) ){
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment