[U-Boot] [PATCH v5 8/9] Add cmd_process() to process commands in one place

Wolfgang Denk wd at denx.de
Tue Mar 6 21:11:01 CET 2012


Dear Simon Glass,

In message <1329285566-30386-9-git-send-email-sjg at chromium.org> you wrote:
> We currently have the same code in hush.c and main.c. This brings the
> code into one place.
> 
> As an added feature, if the command function returns CMD_RET_USAGE then
> cmd_process() will print a usage message for the command before
> returning the standard failure code of 1.
> 
> ARM code size increases about 32 bytes with this clean-up.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> Changes in v4:
> - Add a 'repeatable' parameter to cmd_process()
> - Make cmd_process() return only success (0) or failure (1)
> - Rationalise return codes to 0, 1 and usage
> 
> Changes in v5:
> - Use existing #ifdef __ASSEMBLY__ rather than create a new one
> 
>  common/command.c  |   41 ++++++++++++++++++++++++++++++++++++++++-
>  common/hush.c     |   52 ++++++++++++----------------------------------------
>  common/main.c     |   37 +------------------------------------
>  include/command.h |   29 ++++++++++++++++++++++++++++-
>  4 files changed, 81 insertions(+), 78 deletions(-)

Applied, thanks.

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
... bacteriological warfare ... hard to believe we were once foolish
enough to play around with that.
	-- McCoy, "The Omega Glory", stardate unknown


More information about the U-Boot mailing list