[U-Boot] [RFC] exposing finding a command for subcommands

Wolfgang Denk wd at denx.de
Tue Sep 23 16:37:49 CEST 2008


Dear Kumar Gala,

In message <Pine.LNX.4.64.0809230905440.13402 at blarg.am.freescale.net> you wrote:
> How about something like this for exposing the command table code for
> subcommands.  I'll follow this up with an example of usage based on the
> bootm subcommand patch

Looks good to me. Just a question:

> -cmd_tbl_t *find_cmd (const char *cmd)
> +cmd_tbl_t *__find_cmd (const char *cmd, cmd_tbl_t *table, int table_len)

That means we would export __find_cmd() to other functions? We
shouldn't do that - "__" names are reserved.

> +#define U_BOOT_CMD_INIT(name,maxargs,rep,cmd,usage,help) \
> +{#name, maxargs, rep, cmd, usage, help}
> +

I think "INIT" is not a good name here. To me it sounds like a macro
to use just once. How about "ENTRY" or "MKENT" or something like this?

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
"Open the pod bay doors, HAL."                    - Dave Bowman, 2001


More information about the U-Boot mailing list