aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@mailbox.org>2023-12-02 21:52:31 +0100
committerTom Rini <trini@konsulko.com>2023-12-20 10:46:54 -0500
commit0de448d03254617a902bc6081a7aba214b54b69d (patch)
tree21f4d75dbec7d6c9b278964635036622c69bef72
parent400cb2a850546e8cc9246cf97f0902ffe57867ab (diff)
downloadu-boot-0de448d03254617a902bc6081a7aba214b54b69d.zip
u-boot-0de448d03254617a902bc6081a7aba214b54b69d.tar.gz
u-boot-0de448d03254617a902bc6081a7aba214b54b69d.tar.bz2
command: Move command completion temporary buffer to stack
The command completion temporary buffer seems to be only used by the argv tokenizer, move it to stack. This saves 2 kiB from the binary size (depends on configuration) per: $ aarch64-linux-gnu-readelf -s u-boot | sort -n -k 3 Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--common/command.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/common/command.c b/common/command.c
index 846e16e..7821c27 100644
--- a/common/command.c
+++ b/common/command.c
@@ -355,10 +355,9 @@ static int find_common_prefix(char *const argv[])
return len;
}
-static char tmp_buf[CONFIG_SYS_CBSIZE + 1]; /* copy of console I/O buffer */
-
int cmd_auto_complete(const char *const prompt, char *buf, int *np, int *colp)
{
+ char tmp_buf[CONFIG_SYS_CBSIZE + 1]; /* copy of console I/O buffer */
int n = *np, col = *colp;
char *argv[CONFIG_SYS_MAXARGS + 1]; /* NULL terminated */
char *cmdv[20];