[U-Boot] [PATCH 1/2] Create a single cmd_call() function to handle command execution
Wolfgang Denk
wd at denx.de
Tue Oct 25 09:46:38 CEST 2011
Dear Simon Glass,
In message <1319514744-18697-1-git-send-email-sjg at chromium.org> you wrote:
> We should aim for a single point of entry to the commands, whichever
> parser is used.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> common/command.c | 10 ++++++++++
> common/hush.c | 9 +++------
> common/main.c | 3 +--
> include/command.h | 12 ++++++++++++
> 4 files changed, 26 insertions(+), 8 deletions(-)
>
> diff --git a/common/command.c b/common/command.c
> index c5cecd3..acc1c15 100644
> --- a/common/command.c
> +++ b/common/command.c
> @@ -487,3 +487,13 @@ void fixup_cmdtable(cmd_tbl_t *cmdtp, int size)
> }
> }
> #endif
> +
> +int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> +{
> + int result;
> +
> + result = (cmdtp->cmd)(cmdtp, flag, argc, argv);
> + if (result)
> + debug("Command failed, result=%d", result);
> + return result;
> +}
What exactly is the purpose of this additional function? Except for
the debug() it provides only overhead and no benefit.
I don't think I want to have that.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Mr. Cole's Axiom:
The sum of the intelligence on the planet is a constant;
the population is growing.
More information about the U-Boot
mailing list