params: Introduce the param_unknown_fn type
Introduce a new type for the callback to parse an unknown argument. This unifies function prototypes which takes that as a parameter. Reviewed-by: Luis Chamberlain <mcgrof@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20231120151419.1661807-2-andriy.shevchenko@linux.intel.com Signed-off-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
committed by
Kees Cook
parent
aabf7c37df
commit
12cd3cd8c7
+2
-6
@@ -120,9 +120,7 @@ static int parse_one(char *param,
|
||||
unsigned num_params,
|
||||
s16 min_level,
|
||||
s16 max_level,
|
||||
void *arg,
|
||||
int (*handle_unknown)(char *param, char *val,
|
||||
const char *doing, void *arg))
|
||||
void *arg, parse_unknown_fn handle_unknown)
|
||||
{
|
||||
unsigned int i;
|
||||
int err;
|
||||
@@ -165,9 +163,7 @@ char *parse_args(const char *doing,
|
||||
unsigned num,
|
||||
s16 min_level,
|
||||
s16 max_level,
|
||||
void *arg,
|
||||
int (*unknown)(char *param, char *val,
|
||||
const char *doing, void *arg))
|
||||
void *arg, parse_unknown_fn unknown)
|
||||
{
|
||||
char *param, *val, *err = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user