[U-Boot] [PATCH 7/9] Allow command code to compile to nothing

Stephen Warren swarren at wwwdotorg.org
Tue Mar 1 00:40:59 CET 2016


On 02/25/2016 09:00 PM, Simon Glass wrote:
> When CONFIG_CMDLINE is disabled we need to remove all the command-line
> code. Most can be removed by dropping the appropriate linker lists from the
> images, but sub-commands must be dealt with specially.
>
> A simple mechanism is used to avoid 'unused static function' errors.

> diff --git a/include/command.h b/include/command.h

> +/**
> + * board_run_command() - Fallback function to execute a command
> + *
> + * When no command line features are enabled in U-Boot, this function is
> + * called to execute a command. Typically the function can look at the
> + * command and perform a few very specific tasks, such as booting the
> + * system in a particular way.
> + *
> + * This function is only used when CONFIG_CMDLINE is not enabled.
> + *
> + * In normal situations this function should not return, since U-Boot will
> + * simply hang.
> + *
> + * @cmdline:	Command line string to execute
> + * @return 0 if OK, 1 for error
> + */
> +int board_run_command(const char *cmdline);

Doesn't this need to be part of patch 5/9 too, since the function is 
first called there?


More information about the U-Boot mailing list