diff mbox

[U-Boot] common/command.c: revert chanches from commit 199adb60

Message ID 1352375533-32145-1-git-send-email-agust@denx.de
State Accepted
Delegated to: Anatolij Gustschin
Headers show

Commit Message

Anatolij Gustschin Nov. 8, 2012, 11:52 a.m. UTC
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>
---
 common/command.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

Comments

Anatolij Gustschin Nov. 8, 2012, 12:42 p.m. UTC | #1
On Thu,  8 Nov 2012 12:52:13 +0100
Anatolij Gustschin <agust@denx.de> wrote:

> 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>
> ---
>  common/command.c |    9 +--------
>  1 files changed, 1 insertions(+), 8 deletions(-)

Applied to u-boot-staging/agust@denx.de-urgent.

Anatolij
Albert ARIBAUD Nov. 10, 2012, 11:21 a.m. UTC | #2
Hi Anatolij,

On Thu, 8 Nov 2012 13:42:14 +0100, Anatolij Gustschin <agust@denx.de>
wrote:

> On Thu,  8 Nov 2012 12:52:13 +0100
> Anatolij Gustschin <agust@denx.de> wrote:
> 
> > 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>
> > ---
> >  common/command.c |    9 +--------
> >  1 files changed, 1 insertions(+), 8 deletions(-)
> 
> Applied to u-boot-staging/agust@denx.de-urgent.

Did you fix the typo in the commit summary/subject on the fly?

Amicalement,
Anatolij Gustschin Nov. 10, 2012, 11:41 a.m. UTC | #3
Hi Albert,

On Sat, 10 Nov 2012 12:21:55 +0100
Albert ARIBAUD <albert.u.boot@aribaud.net> wrote:
...
> > 
> > Applied to u-boot-staging/agust@denx.de-urgent.
> 
> Did you fix the typo in the commit summary/subject on the fly?

yes, I noticed it when applying, it wasn't worth it to resubmit the patch.

Thanks,
Anatolij
Mela Custodio Dec. 14, 2012, 4:13 a.m. UTC | #4
Dear Anatolij,

Anatolij Gustschin <agust <at> denx.de> writes:

> 
> Hi Albert,
> 
> On Sat, 10 Nov 2012 12:21:55 +0100
> Albert ARIBAUD <albert.u.boot <at> aribaud.net> wrote:
> ...
> > > 
> > > Applied to u-boot-staging/agust <at> denx.de-urgent.

*bump*

This seems to be still missing in master.

All the best,
Rommel

> > 
> > Did you fix the typo in the commit summary/subject on the fly?
> 
> yes, I noticed it when applying, it wasn't worth it to resubmit the patch.
> 
> Thanks,
> Anatolij
>
Anatolij Gustschin Dec. 14, 2012, 7:51 a.m. UTC | #5
Hi Rommel,

On Fri, 14 Dec 2012 04:13:34 +0000 (UTC)
Rommel Custodio <sessyargc@gmail.com> wrote:
...
> > > > Applied to u-boot-staging/agust <at> denx.de-urgent.
> 
> *bump*
> 
> This seems to be still missing in master.

This patch is already in master, here is the commit [1].

Thanks,
Anatolij 

[1] http://git.denx.de/?p=u-boot.git;a=commit;h=22b6fcb50d06ee281a338e78f8d0a7c9ddee8629
diff mbox

Patch

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 */