Bruce Richardson <bruce.richard...@intel.com> writes:
> The cmdline library cmdline_parse() function parses a command and > executes the action automatically too. The cmdline_valid_buffer function > also uses this function to validate commands, meaning that there is no > function to validate a command as ok without executing it. > > To fix this omission, we extract the body of cmdline_parse into a new > static inline function with an extra parameter to indicate whether the > action should be performed or not. Then we create two wrappers around > that - a replacement for the existing cmdline_parse function where the > extra parameter is "true" to execute the command, and a new function > "cmdline_parse_check" which passes the parameter as "false" to perform > cmdline validation only. > > Signed-off-by: Bruce Richardson <bruce.richard...@intel.com> > --- > lib/cmdline/cmdline_parse.c | 20 +++++++++++++++++--- > lib/cmdline/cmdline_parse.h | 17 +++++++++++++++-- > lib/cmdline/version.map | 3 +++ > 3 files changed, 35 insertions(+), 5 deletions(-) Acked-by: Ray Kinsella <m...@ashroe.eu>