X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=common%2Fcommand.c;h=e5d9b9cf959c913304348f7147bb57f72ab53934;hb=beb71279d865deb77b2faa86d7d1d180df8339a0;hp=4719f4978ba637edb2ff4cc1b7ee67cb3462cfc7;hpb=616e2162a5726a6a2617f43bf14e6f75fe928b18;p=oweals%2Fu-boot.git diff --git a/common/command.c b/common/command.c index 4719f4978b..e5d9b9cf95 100644 --- a/common/command.c +++ b/common/command.c @@ -11,6 +11,7 @@ #include #include +#include #include /* @@ -84,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; @@ -110,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 */ } @@ -161,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; @@ -230,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[]) @@ -445,7 +452,7 @@ void fixup_cmdtable(cmd_tbl_t *cmdtp, int size) ulong addr; addr = (ulong)(cmdtp->cmd) + gd->reloc_off; -#if DEBUG_COMMANDS +#ifdef DEBUG_COMMANDS printf("Command \"%s\": 0x%08lx => 0x%08lx\n", cmdtp->name, (ulong)(cmdtp->cmd), addr); #endif @@ -492,7 +499,7 @@ static int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) result = (cmdtp->cmd)(cmdtp, flag, argc, argv); if (result) - debug("Command failed, result=%d", result); + debug("Command failed, result=%d\n", result); return result; }