> -----Original Message----- > From: Richardson, Bruce <[email protected]> > Sent: Friday, May 20, 2022 11:13 PM > To: [email protected] > Cc: [email protected]; Li, WeiyuanX <[email protected]>; Richardson, > Bruce <[email protected]>; Olivier Matz > <[email protected]>; Ray Kinsella <[email protected]> > Subject: [PATCH v2 1/2] cmdline: add function to verify valid commands > > 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 <[email protected]> > ---
Tested-by: Weiyuan Li <[email protected]> Regards, Li, Weiyuan

