diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-11-03 09:57:30 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-11-03 09:57:30 -0800 |
commit | ce2e33ba4163c66ff89d2c0f2a9a51214a122e27 (patch) | |
tree | 7aa7f973d0ce31920b3218596e81e82152c122f8 /scripts | |
parent | 43c834186c185abc53b41ee985330501ccfc4f7b (diff) | |
parent | 4f3e69060dc9cc8f14ad9e172ada7120dc76445b (diff) |
Merge tag 'docs-5.10-3' of git://git.lwn.net/linux
Pull documentation fixes from Jonathan Corbet:
"A small number of fixes, plus a build tweak to respect the desire for
silence in V=0 builds"
* tag 'docs-5.10-3' of git://git.lwn.net/linux:
docs: fix automarkup regression on Python 2
documentation: arm: sunxi: add Allwinner H6 documents
scripts: kernel-doc: split typedef complex regex
scripts: kernel-doc: fix typedef parsing
docs: Makefile: honor V=0 for docs building
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/kernel-doc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index c8f6b11d5da1..cf71897df36d 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1427,20 +1427,25 @@ sub dump_enum($$) { } } +my $typedef_type = qr { ((?:\s+[\w\*]+){1,8})\s* }x; +my $typedef_ident = qr { \*?\s*(\w\S+)\s* }x; +my $typedef_args = qr { \s*\((.*)\); }x; + +my $typedef1 = qr { typedef$typedef_type\($typedef_ident\)$typedef_args }x; +my $typedef2 = qr { typedef$typedef_type$typedef_ident$typedef_args }x; + sub dump_typedef($$) { my $x = shift; my $file = shift; $x =~ s@/\*.*?\*/@@gos; # strip comments. - # Parse function prototypes - if ($x =~ /typedef\s+(\w+)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ || - $x =~ /typedef\s+(\w+)\s*(\w\S+)\s*\s*\((.*)\);/) { - - # Function typedefs + # Parse function typedef prototypes + if ($x =~ $typedef1 || $x =~ $typedef2) { $return_type = $1; $declaration_name = $2; my $args = $3; + $return_type =~ s/^\s+//; create_parameterlist($args, ',', $file, $declaration_name); |