summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatolij Gustschin <agust@denx.de>2012-11-08 12:40:17 +0100
committerAnatolij Gustschin <agust@denx.de>2012-11-08 13:18:10 +0100
commit22b6fcb50d06ee281a338e78f8d0a7c9ddee8629 (patch)
treebca6d8c62dd0af05b0618af4468918594d3ac740
parent1cc619be8b73abbee2fd6faf2cd4ade27b516531 (diff)
downloadu-boot-imx-22b6fcb50d06ee281a338e78f8d0a7c9ddee8629.zip
u-boot-imx-22b6fcb50d06ee281a338e78f8d0a7c9ddee8629.tar.gz
u-boot-imx-22b6fcb50d06ee281a338e78f8d0a7c9ddee8629.tar.bz2
common/command.c: revert changes from commit 199adb60
commit 199adb601ff34bdbbd0667fac80dfe0a87bffc2b "common/misc: sparse fixes" broke the help command trying to fix the sparse error "command.c:44:38: error: bad constant expression". As Henrik points out, the fix was bad because the commit used CONFIG_SYS_MAXARGS whereas the code intended to use the maximum number of commands (not arguments to a command). Revert command.c changes to the original code as asked by Wolfgang. Reported-by: Henrik Nordström <henrik@henriknordstrom.net> Signed-off-by: Anatolij Gustschin <agust@denx.de>
-rw-r--r--common/command.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/common/command.c b/common/command.c
index f51df26..50c8429 100644
--- a/common/command.c
+++ b/common/command.c
@@ -40,15 +40,8 @@ int _do_help (cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t * cmdtp, int
int i;
int rcode = 0;
- if (cmd_items > CONFIG_SYS_MAXARGS) {
- printf("%s: cmd_items %d exceeds hardcoded limit %d."
- " Recompile with higher CONFIG_SYS_MAXARGS?\n",
- __func__, cmd_items, CONFIG_SYS_MAXARGS);
- return -1;
- }
-
if (argc == 1) { /*show list of commands */
- cmd_tbl_t *cmd_array[CONFIG_SYS_MAXARGS];
+ cmd_tbl_t *cmd_array[cmd_items];
int i, j, swaps;
/* Make array of commands from .uboot_cmd section */