@@ -47,15 +47,14 @@ int lookup_constant(const struct constant_table *tbl, const char *name, int not_
4747EXPORT_SYMBOL (lookup_constant );
4848
4949static const struct fs_parameter_spec * fs_lookup_key (
50- const struct fs_parameter_description * desc ,
50+ const struct fs_parameter_spec * desc ,
5151 const char * name )
5252{
5353 const struct fs_parameter_spec * p ;
54-
55- if (!desc -> specs )
54+ if (!desc )
5655 return NULL ;
5756
58- for (p = desc -> specs ; p -> name ; p ++ )
57+ for (p = desc ; p -> name ; p ++ )
5958 if (strcmp (p -> name , name ) == 0 )
6059 return p ;
6160
@@ -81,7 +80,7 @@ static const struct fs_parameter_spec *fs_lookup_key(
8180 * the parameter wasn't recognised and unknowns aren't okay.
8281 */
8382int __fs_parse (struct p_log * log ,
84- const struct fs_parameter_description * desc ,
83+ const struct fs_parameter_spec * desc ,
8584 struct fs_parameter * param ,
8685 struct fs_parse_result * result )
8786{
@@ -355,39 +354,37 @@ bool validate_constant_table(const struct constant_table *tbl, size_t tbl_size,
355354 * @desc: The parameter description to validate.
356355 */
357356bool fs_validate_description (const char * name ,
358- const struct fs_parameter_description * desc )
357+ const struct fs_parameter_spec * desc )
359358{
360359 const struct fs_parameter_spec * param , * p2 ;
361360 bool good = true;
362361
363362 pr_notice ("*** VALIDATE %s ***\n" , name );
364363
365- if (desc -> specs ) {
366- for (param = desc -> specs ; param -> name ; param ++ ) {
367- enum fs_parameter_type t = param -> type ;
364+ for (param = desc ; param -> name ; param ++ ) {
365+ enum fs_parameter_type t = param -> type ;
368366
369- /* Check that the type is in range */
370- if (t == __fs_param_wasnt_defined ||
371- t >= nr__fs_parameter_type ) {
372- pr_err ("VALIDATE %s: PARAM[%s] Bad type %u\n" ,
373- name , param -> name , t );
367+ /* Check that the type is in range */
368+ if (t == __fs_param_wasnt_defined ||
369+ t >= nr__fs_parameter_type ) {
370+ pr_err ("VALIDATE %s: PARAM[%s] Bad type %u\n" ,
371+ name , param -> name , t );
372+ good = false;
373+ } else if (t == fs_param_is_enum ) {
374+ const struct constant_table * e = param -> data ;
375+ if (!e || !e -> name ) {
376+ pr_err ("VALIDATE %s: PARAM[%s] enum with no values\n" ,
377+ name , param -> name );
374378 good = false;
375- } else if (t == fs_param_is_enum ) {
376- const struct constant_table * e = param -> data ;
377- if (!e || !e -> name ) {
378- pr_err ("VALIDATE %s: PARAM[%s] enum with no values\n" ,
379- name , param -> name );
380- good = false;
381- }
382379 }
380+ }
383381
384- /* Check for duplicate parameter names */
385- for (p2 = desc -> specs ; p2 < param ; p2 ++ ) {
386- if (strcmp (param -> name , p2 -> name ) == 0 ) {
387- pr_err ("VALIDATE %s: PARAM[%s]: Duplicate\n" ,
388- name , param -> name );
389- good = false;
390- }
382+ /* Check for duplicate parameter names */
383+ for (p2 = desc ; p2 < param ; p2 ++ ) {
384+ if (strcmp (param -> name , p2 -> name ) == 0 ) {
385+ pr_err ("VALIDATE %s: PARAM[%s]: Duplicate\n" ,
386+ name , param -> name );
387+ good = false;
391388 }
392389 }
393390 }
0 commit comments