Commit 22b6fcb50d06ee281a338e78f8d0a7c9ddee8629
1 parent
1cc619be8b
Exists in
master
and in
54 other branches
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>
Showing 1 changed file with 1 additions and 8 deletions Side-by-side Diff
common/command.c
... | ... | @@ -40,15 +40,8 @@ |
40 | 40 | int i; |
41 | 41 | int rcode = 0; |
42 | 42 | |
43 | - if (cmd_items > CONFIG_SYS_MAXARGS) { | |
44 | - printf("%s: cmd_items %d exceeds hardcoded limit %d." | |
45 | - " Recompile with higher CONFIG_SYS_MAXARGS?\n", | |
46 | - __func__, cmd_items, CONFIG_SYS_MAXARGS); | |
47 | - return -1; | |
48 | - } | |
49 | - | |
50 | 43 | if (argc == 1) { /*show list of commands */ |
51 | - cmd_tbl_t *cmd_array[CONFIG_SYS_MAXARGS]; | |
44 | + cmd_tbl_t *cmd_array[cmd_items]; | |
52 | 45 | int i, j, swaps; |
53 | 46 | |
54 | 47 | /* Make array of commands from .uboot_cmd section */ |