diff options
| author | Viresh Kumar <viresh.kumar@linaro.org> | 2020-12-08 11:22:17 +0530 |
|---|---|---|
| committer | Viresh Kumar <viresh.kumar@linaro.org> | 2020-12-08 11:22:17 +0530 |
| commit | c8bb4520543823a9b3da3861304273dc7232e2c7 (patch) | |
| tree | 26670815d56dfc89fbe55e77c8e987324b70f95f /scripts/kernel-doc | |
| parent | f45f89a778e8a61d9c79405e8c716058b6ba12f2 (diff) | |
| parent | f9b0498d29404f230894490d622e57e481c7d45a (diff) | |
| download | linux-c8bb4520543823a9b3da3861304273dc7232e2c7.tar.gz linux-c8bb4520543823a9b3da3861304273dc7232e2c7.zip | |
Merge branch 'cpufreq/scmi' into cpufreq/arm/linux-next
Diffstat (limited to 'scripts/kernel-doc')
| -rwxr-xr-x | scripts/kernel-doc | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index c8f6b11d5da1..f699cf05d409 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1092,7 +1092,11 @@ sub output_struct_rst(%) { print "\n\n.. c:type:: " . $name . "\n\n"; } else { my $name = $args{'struct'}; - print "\n\n.. c:struct:: " . $name . "\n\n"; + if ($args{'type'} eq 'union') { + print "\n\n.. c:union:: " . $name . "\n\n"; + } else { + print "\n\n.. c:struct:: " . $name . "\n\n"; + } } print_lineno($declaration_start_line); $lineprefix = " "; @@ -1427,20 +1431,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); |
