From 420a3173f0f7d2bd35f32be437e4888a82047560 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 19 Oct 2009 16:16:54 +0200 Subject: commands: remove maxargs No need to check for maximum argument counts. The commands are safe to be called with more arguments, so lets safe some bytes. Signed-off-by: Sascha Hauer --- common/command.c | 6 ------ common/hush.c | 2 -- 2 files changed, 8 deletions(-) (limited to 'common') diff --git a/common/command.c b/common/command.c index e6b4aff8b8..f484520572 100644 --- a/common/command.c +++ b/common/command.c @@ -56,7 +56,6 @@ static int do_exit (cmd_tbl_t *cmdtp, int argc, char *argv[]) } U_BOOT_CMD_START(exit) - .maxargs = 2, .cmd = do_exit, .usage = "exit script", U_BOOT_CMD_END @@ -101,11 +100,6 @@ int execute_command(int argc, char **argv) /* Look up command in command table */ if ((cmdtp = find_cmd(argv[0]))) { - /* found - check max args */ - if (argc > cmdtp->maxargs) { - u_boot_cmd_usage(cmdtp); - return -1; - } /* OK - call function to do the command */ ret = cmdtp->cmd(cmdtp, argc, argv); if (ret == COMMAND_ERROR_USAGE) { diff --git a/common/hush.c b/common/hush.c index 70ccd047e3..0e58e99e61 100644 --- a/common/hush.c +++ b/common/hush.c @@ -1594,7 +1594,6 @@ static const __maybe_unused char cmd_sh_help[] = "Execute a shell script\n"; U_BOOT_CMD_START(sh) - .maxargs = CONFIG_MAXARGS, .cmd = do_sh, .usage = "run shell script", U_BOOT_CMD_HELP(cmd_sh_help) @@ -1622,7 +1621,6 @@ static const __maybe_unused char cmd_source_usage[] = "execute shell script in current shell environment"; U_BOOT_CMD_START(source) - .maxargs = CONFIG_MAXARGS, .aliases = source_aliases, .cmd = do_source, .usage = cmd_source_usage, -- cgit v1.2.3