diff options
Diffstat (limited to 'scripts/kernel-doc')
-rwxr-xr-x | scripts/kernel-doc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 21f2f3fee745..351def5c6b8f 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -253,6 +253,7 @@ my $lineprefix=""; | |||
253 | # 3 - scanning prototype. | 253 | # 3 - scanning prototype. |
254 | # 4 - documentation block | 254 | # 4 - documentation block |
255 | my $state; | 255 | my $state; |
256 | my $in_doc_sect; | ||
256 | 257 | ||
257 | #declaration types: can be | 258 | #declaration types: can be |
258 | # 'function', 'struct', 'union', 'enum', 'typedef' | 259 | # 'function', 'struct', 'union', 'enum', 'typedef' |
@@ -1706,6 +1707,7 @@ sub process_file($) { | |||
1706 | if ($state == 0) { | 1707 | if ($state == 0) { |
1707 | if (/$doc_start/o) { | 1708 | if (/$doc_start/o) { |
1708 | $state = 1; # next line is always the function name | 1709 | $state = 1; # next line is always the function name |
1710 | $in_doc_sect = 0; | ||
1709 | } | 1711 | } |
1710 | } elsif ($state == 1) { # this line is the function name (always) | 1712 | } elsif ($state == 1) { # this line is the function name (always) |
1711 | if (/$doc_block/o) { | 1713 | if (/$doc_block/o) { |
@@ -1756,10 +1758,15 @@ sub process_file($) { | |||
1756 | $newcontents = $2; | 1758 | $newcontents = $2; |
1757 | 1759 | ||
1758 | if ($contents ne "") { | 1760 | if ($contents ne "") { |
1761 | if (!$in_doc_sect && $verbose) { | ||
1762 | print STDERR "Warning(${file}:$.): contents before sections\n"; | ||
1763 | ++$warnings; | ||
1764 | } | ||
1759 | dump_section($section, xml_escape($contents)); | 1765 | dump_section($section, xml_escape($contents)); |
1760 | $section = $section_default; | 1766 | $section = $section_default; |
1761 | } | 1767 | } |
1762 | 1768 | ||
1769 | $in_doc_sect = 1; | ||
1763 | $contents = $newcontents; | 1770 | $contents = $newcontents; |
1764 | if ($contents ne "") { | 1771 | if ($contents ne "") { |
1765 | if (substr($contents, 0, 1) eq " ") { | 1772 | if (substr($contents, 0, 1) eq " ") { |