diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2024-01-31 10:49:34 +0200 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2024-02-05 09:53:02 -0700 |
commit | bbf00be93e09081ffa06e6fd84ed8f4e469a99d0 (patch) | |
tree | a95b296ae6dbe50c0e55b0761e5a9911771da00b /scripts | |
parent | 5c7944ca7b13978744ec83e131aef9255fdbabbe (diff) | |
download | linux-bbf00be93e09081ffa06e6fd84ed8f4e469a99d0.tar.gz linux-bbf00be93e09081ffa06e6fd84ed8f4e469a99d0.tar.bz2 linux-bbf00be93e09081ffa06e6fd84ed8f4e469a99d0.zip |
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.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20240131084934.191226-1-sakari.ailus@linux.intel.com
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/kernel-doc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 915e7bd97486..014ef55351be 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1509,6 +1509,15 @@ sub create_parameterlist($$$$) { $type =~ s/([^\(]+\(\*?)\s*$param/$1/; save_struct_actual($param); push_parameter($param, $type, $arg, $file, $declaration_name); + } elsif ($arg =~ m/\(.+\)\s*\[/) { + # array-of-pointers + $arg =~ tr/#/,/; + $arg =~ m/[^\(]+\(\s*\*\s*([\w\[\]\.]*?)\s*(\s*\[\s*[\w]+\s*\]\s*)*\)/; + $param = $1; + $type = $arg; + $type =~ s/([^\(]+\(\*?)\s*$param/$1/; + save_struct_actual($param); + push_parameter($param, $type, $arg, $file, $declaration_name); } elsif ($arg) { $arg =~ s/\s*:\s*/:/g; $arg =~ s/\s*\[/\[/g; |