History

kernel-doc: Support arrays of pointers struct fields

In a rather unusual arrangement in include/media/v4l2-vp9.h struct v4l2_vp9_frame_symbol_counts has fields that are arrays of pointers, not a pointer to an array, which is what's usually done. Add support for such arrays of pointers to kernel-doc.

Sakari Ailus committed 2 years ago

Commit bbf00be1 parent 5c7944c1 file · +9 −0Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/kernel-doc+9−0
@@ -1509,6 +1509,15 @@ sub create_parameterlist($$$$) { · 1508 unmodified lines
1509 $type =~ s/([^\(]+\(\*?)\s*$param/$1/;1509 $type =~ s/([^\(]+\(\*?)\s*$param/$1/;
1510 save_struct_actual($param);1510 save_struct_actual($param);
1511 push_parameter($param, $type, $arg, $file, $declaration_name);1511 push_parameter($param, $type, $arg, $file, $declaration_name);
1512 } elsif ($arg =~ m/\(.+\)\s*\[/) {
1513 # array-of-pointers
1514 $arg =~ tr/#/,/;
1515 $arg =~ m/[^\(]+\(\s*\*\s*([\w\[\]\.]*?)\s*(\s*\[\s*[\w]+\s*\]\s*)*\)/;
1516 $param = $1;
1517 $type = $arg;
1518 $type =~ s/([^\(]+\(\*?)\s*$param/$1/;
1519 save_struct_actual($param);
1520 push_parameter($param, $type, $arg, $file, $declaration_name);
1512 } elsif ($arg) {1521 } elsif ($arg) {
1513 $arg =~ s/\s*:\s*/:/g;1522 $arg =~ s/\s*:\s*/:/g;
1514 $arg =~ s/\s*\[/\[/g;1523 $arg =~ s/\s*\[/\[/g;