diff options
Diffstat (limited to 'scripts/kernel-doc')
| -rwxr-xr-x | scripts/kernel-doc | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index ea9f8a58678f..fcdfb245a575 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
| @@ -13,8 +13,6 @@ use strict; | |||
| 13 | ## This software falls under the GNU General Public License. ## | 13 | ## This software falls under the GNU General Public License. ## |
| 14 | ## Please read the COPYING file for more information ## | 14 | ## Please read the COPYING file for more information ## |
| 15 | 15 | ||
| 16 | # w.o. 03-11-2000: added the '-filelist' option. | ||
| 17 | |||
| 18 | # 18/01/2001 - Cleanups | 16 | # 18/01/2001 - Cleanups |
| 19 | # Functions prototyped as foo(void) same as foo() | 17 | # Functions prototyped as foo(void) same as foo() |
| 20 | # Stop eval'ing where we don't need to. | 18 | # Stop eval'ing where we don't need to. |
| @@ -245,7 +243,7 @@ my $man_date = ('January', 'February', 'March', 'April', 'May', 'June', | |||
| 245 | # could cause "use of undefined value" or other bugs. | 243 | # could cause "use of undefined value" or other bugs. |
| 246 | my ($function, %function_table, %parametertypes, $declaration_purpose); | 244 | my ($function, %function_table, %parametertypes, $declaration_purpose); |
| 247 | my ($type, $declaration_name, $return_type); | 245 | my ($type, $declaration_name, $return_type); |
| 248 | my ($newsection, $newcontents, $prototype, $filelist, $brcount, %source_map); | 246 | my ($newsection, $newcontents, $prototype, $brcount, %source_map); |
| 249 | 247 | ||
| 250 | if (defined($ENV{'KBUILD_VERBOSE'})) { | 248 | if (defined($ENV{'KBUILD_VERBOSE'})) { |
| 251 | $verbose = "$ENV{'KBUILD_VERBOSE'}"; | 249 | $verbose = "$ENV{'KBUILD_VERBOSE'}"; |
| @@ -338,8 +336,6 @@ while ($ARGV[0] =~ m/^-(.*)/) { | |||
| 338 | $verbose = 1; | 336 | $verbose = 1; |
| 339 | } elsif (($cmd eq "-h") || ($cmd eq "--help")) { | 337 | } elsif (($cmd eq "-h") || ($cmd eq "--help")) { |
| 340 | usage(); | 338 | usage(); |
| 341 | } elsif ($cmd eq '-filelist') { | ||
| 342 | $filelist = shift @ARGV; | ||
| 343 | } elsif ($cmd eq '-no-doc-sections') { | 339 | } elsif ($cmd eq '-no-doc-sections') { |
| 344 | $no_doc_sections = 1; | 340 | $no_doc_sections = 1; |
| 345 | } | 341 | } |
| @@ -1428,6 +1424,8 @@ sub dump_struct($$) { | |||
| 1428 | $nested =~ s/\/\*.*?\*\///gos; | 1424 | $nested =~ s/\/\*.*?\*\///gos; |
| 1429 | # strip kmemcheck_bitfield_{begin,end}.*; | 1425 | # strip kmemcheck_bitfield_{begin,end}.*; |
| 1430 | $members =~ s/kmemcheck_bitfield_.*?;//gos; | 1426 | $members =~ s/kmemcheck_bitfield_.*?;//gos; |
| 1427 | # strip attributes | ||
| 1428 | $members =~ s/__aligned\s*\(\d+\)//gos; | ||
| 1431 | 1429 | ||
| 1432 | create_parameterlist($members, ';', $file); | 1430 | create_parameterlist($members, ';', $file); |
| 1433 | check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested); | 1431 | check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested); |
| @@ -1732,6 +1730,7 @@ sub dump_function($$) { | |||
| 1732 | $prototype =~ s/^noinline +//; | 1730 | $prototype =~ s/^noinline +//; |
| 1733 | $prototype =~ s/__devinit +//; | 1731 | $prototype =~ s/__devinit +//; |
| 1734 | $prototype =~ s/__init +//; | 1732 | $prototype =~ s/__init +//; |
| 1733 | $prototype =~ s/__init_or_module +//; | ||
| 1735 | $prototype =~ s/^#\s*define\s+//; #ak added | 1734 | $prototype =~ s/^#\s*define\s+//; #ak added |
| 1736 | $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; | 1735 | $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; |
| 1737 | 1736 | ||
| @@ -1811,14 +1810,6 @@ if (open(SOURCE_MAP, "<.tmp_filelist.txt")) { | |||
| 1811 | close(SOURCE_MAP); | 1810 | close(SOURCE_MAP); |
| 1812 | } | 1811 | } |
| 1813 | 1812 | ||
| 1814 | if ($filelist) { | ||
| 1815 | open(FLIST,"<$filelist") or die "Can't open file list $filelist"; | ||
| 1816 | while(<FLIST>) { | ||
| 1817 | chop; | ||
| 1818 | process_file($_); | ||
| 1819 | } | ||
| 1820 | } | ||
| 1821 | |||
| 1822 | foreach (@ARGV) { | 1813 | foreach (@ARGV) { |
| 1823 | chomp; | 1814 | chomp; |
| 1824 | process_file($_); | 1815 | process_file($_); |
| @@ -1852,10 +1843,17 @@ sub tracepoint_munge($) { | |||
| 1852 | my $tracepointname = 0; | 1843 | my $tracepointname = 0; |
| 1853 | my $tracepointargs = 0; | 1844 | my $tracepointargs = 0; |
| 1854 | 1845 | ||
| 1855 | if($prototype =~ m/TRACE_EVENT\((.*?),/) { | 1846 | if ($prototype =~ m/TRACE_EVENT\((.*?),/) { |
| 1847 | $tracepointname = $1; | ||
| 1848 | } | ||
| 1849 | if ($prototype =~ m/DEFINE_SINGLE_EVENT\((.*?),/) { | ||
| 1856 | $tracepointname = $1; | 1850 | $tracepointname = $1; |
| 1857 | } | 1851 | } |
| 1858 | if($prototype =~ m/TP_PROTO\((.*?)\)/) { | 1852 | if ($prototype =~ m/DEFINE_EVENT\((.*?),(.*?),/) { |
| 1853 | $tracepointname = $2; | ||
| 1854 | } | ||
| 1855 | $tracepointname =~ s/^\s+//; #strip leading whitespace | ||
| 1856 | if ($prototype =~ m/TP_PROTO\((.*?)\)/) { | ||
| 1859 | $tracepointargs = $1; | 1857 | $tracepointargs = $1; |
| 1860 | } | 1858 | } |
| 1861 | if (($tracepointname eq 0) || ($tracepointargs eq 0)) { | 1859 | if (($tracepointname eq 0) || ($tracepointargs eq 0)) { |
| @@ -1920,7 +1918,9 @@ sub process_state3_function($$) { | |||
| 1920 | if ($prototype =~ /SYSCALL_DEFINE/) { | 1918 | if ($prototype =~ /SYSCALL_DEFINE/) { |
| 1921 | syscall_munge(); | 1919 | syscall_munge(); |
| 1922 | } | 1920 | } |
| 1923 | if ($prototype =~ /TRACE_EVENT/) { | 1921 | if ($prototype =~ /TRACE_EVENT/ || $prototype =~ /DEFINE_EVENT/ || |
| 1922 | $prototype =~ /DEFINE_SINGLE_EVENT/) | ||
| 1923 | { | ||
| 1924 | tracepoint_munge($file); | 1924 | tracepoint_munge($file); |
| 1925 | } | 1925 | } |
| 1926 | dump_function($prototype, $file); | 1926 | dump_function($prototype, $file); |
| @@ -2014,6 +2014,8 @@ sub process_file($) { | |||
| 2014 | return; | 2014 | return; |
| 2015 | } | 2015 | } |
| 2016 | 2016 | ||
| 2017 | $. = 1; | ||
| 2018 | |||
| 2017 | $section_counter = 0; | 2019 | $section_counter = 0; |
| 2018 | while (<IN>) { | 2020 | while (<IN>) { |
| 2019 | if ($state == 0) { | 2021 | if ($state == 0) { |
| @@ -2104,7 +2106,7 @@ sub process_file($) { | |||
| 2104 | $section = $newsection; | 2106 | $section = $newsection; |
| 2105 | } elsif (/$doc_end/) { | 2107 | } elsif (/$doc_end/) { |
| 2106 | 2108 | ||
| 2107 | if ($contents ne "") { | 2109 | if (($contents ne "") && ($contents ne "\n")) { |
| 2108 | dump_section($file, $section, xml_escape($contents)); | 2110 | dump_section($file, $section, xml_escape($contents)); |
| 2109 | $section = $section_default; | 2111 | $section = $section_default; |
| 2110 | $contents = ""; | 2112 | $contents = ""; |
