diff options
author | Simon Glass <sjg@chromium.org> | 2016-03-19 02:18:38 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-04-01 17:17:40 -0400 |
commit | f8bb69643550fccbf1df514deda53089da7940e3 (patch) | |
tree | 769b0055eb9516ddad955b1219edefd5f421d8a6 /common/command.c | |
parent | 74322201dde4593dc3194c702e95e5760e6b497a (diff) | |
download | u-boot-f8bb69643550fccbf1df514deda53089da7940e3.tar.gz |
Drop command-processing code when CONFIG_CMDLINE is disabled
Command parsing and processing code is not needed when the command line is
disabled. Remove this code in that case.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common/command.c')
-rw-r--r-- | common/command.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/common/command.c b/common/command.c index 858e28885a..e5d9b9cf95 100644 --- a/common/command.c +++ b/common/command.c @@ -85,6 +85,7 @@ int _do_help(cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t *cmdtp, int flag, /* find command table entry for a command */ cmd_tbl_t *find_cmd_tbl(const char *cmd, cmd_tbl_t *table, int table_len) { +#ifdef CONFIG_CMDLINE cmd_tbl_t *cmdtp; cmd_tbl_t *cmdtp_temp = table; /* Init value */ const char *p; @@ -111,6 +112,7 @@ cmd_tbl_t *find_cmd_tbl(const char *cmd, cmd_tbl_t *table, int table_len) if (n_found == 1) { /* exactly one match */ return cmdtp_temp; } +#endif /* CONFIG_CMDLINE */ return NULL; /* not found or ambiguous command */ } @@ -162,6 +164,7 @@ int var_complete(int argc, char * const argv[], char last_char, int maxv, char * static int complete_cmdv(int argc, char * const argv[], char last_char, int maxv, char *cmdv[]) { +#ifdef CONFIG_CMDLINE cmd_tbl_t *cmdtp = ll_entry_start(cmd_tbl_t, cmd); const int count = ll_entry_count(cmd_tbl_t, cmd); const cmd_tbl_t *cmdend = cmdtp + count; @@ -231,6 +234,9 @@ static int complete_cmdv(int argc, char * const argv[], char last_char, int maxv cmdv[n_found] = NULL; return n_found; +#else + return 0; +#endif } static int make_argv(char *s, int argvsz, char *argv[]) |