History

Merge tag 'docs/v5.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull documentation updates from Mauro Carvalho Chehab: "A series of patches addressing warnings produced by make htmldocs. This includes: - kernel-doc markup fixes - ReST fixes - Updates at the build system in order to support newer versions of the docs build toolchain (Sphinx) After this series, the number of html build warnings should reduce significantly, and building with Sphinx 3.1 or later should now be supported (although it is still recommended to use Sphinx 2.4.4). As agreed with Jon, I should be sending you a late pull request by the end of the merge window addressing remaining issues with docs build, as there are a number of warning fixes that depends on pull requests that should be happening along the merge window. The end goal is to have a clean htmldocs build on Kernel 5.10. PS. It should be noticed that Sphinx 3.0 is not currently supported, as it lacks support for C domain namespaces. Such feature, needed in order to document uAPI system calls with Sphinx 3.x, was added only on Sphinx 3.1" * tag 'docs/v5.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (75 commits) PM / devfreq: remove a duplicated kernel-doc markup mm/doc: fix a literal block markup workqueue: fix a kernel-doc warning docs: virt: user_mode_linux_howto_v2.rst: fix a literal block markup Input: sparse-keymap: add a description for @sw rcu/tree: docs: document bkvcache new members at struct kfree_rcu_cpu nl80211: docs: add a description for s1g_cap parameter usb: docs: document altmode register/unregister functions kunit: test.h: fix a bad kernel-doc markup drivers: core: fix kernel-doc markup for dev_err_probe() docs: bio: fix a kerneldoc markup kunit: test.h: solve kernel-doc warnings block: bio: fix a warning at the kernel-doc markups docs: powerpc: syscall64-abi.rst: fix a malformed table drivers: net: hamradio: fix document location net: appletalk: Kconfig: Fix docs location dt-bindings: fix references to files converted to yaml memblock: get rid of a :c:type leftover math64.h: kernel-docs: Convert some markups into normal comments media: uAPI: buffer.rst: remove a left-over documentation ...

Linus Torvalds committed 6 years ago

Commit 54a4c782 parents 93f3d8f 3e2ac97309 files · +1952 −2275Browse files

Showing the changes to scripts (1 of 309 files). Show all

Unified · Split

scripts/kernel-doc+223−82
@@ -56,6 +56,13 @@ Output format selection (mutually exclusive): · 55 unmodified lines
5656 -rst Output reStructuredText format.
5757 -none Do not output documentation, only warnings.
5858
59+Output format selection modifier (affects only ReST output):
60+
61+ -sphinx-version Use the ReST C domain dialect compatible with an
62+ specific Sphinx Version.
63+ If not specified, kernel-doc will auto-detect using
64+ the sphinx-build version found on PATH.
65+
5966 Output selection (mutually exclusive):
6067 -export Only output documentation for symbols that have been
6168 exported using EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL()
@@ -66,9 +73,8 @@ Output selection (mutually exclusive): · 4 unmodified lines
6673 -function NAME Only output documentation for the given function(s)
6774 or DOC: section title(s). All other functions and DOC:
6875 sections are ignored. May be specified multiple times.
69− -nofunction NAME Do NOT output documentation for the given function(s);
70− only output documentation for the other functions and
71− DOC: sections. May be specified multiple times.
76+ -nosymbol NAME Exclude the specified symbols from the output
77+ documentation. May be specified multiple times.
7278
7379 Output selection modifiers:
7480 -no-doc-sections Do not output DOC: sections.
@@ -271,6 +277,8 @@ if ($#ARGV == -1) { · 196 unmodified lines
271277 }
272278
273279 my $kernelversion;
280+my ($sphinx_major, $sphinx_minor, $sphinx_patch);
281+
274282 my $dohighlight = "";
275283
276284 my $verbose = 0;
@@ -286,9 +294,8 @@ my $modulename = "Kernel API"; · 9 unmodified lines
286294 use constant {
287295 OUTPUT_ALL => 0, # output all symbols and doc sections
288296 OUTPUT_INCLUDE => 1, # output only specified symbols
289− OUTPUT_EXCLUDE => 2, # output everything except specified symbols
290− OUTPUT_EXPORTED => 3, # output exported symbols
291− OUTPUT_INTERNAL => 4, # output non-exported symbols
297+ OUTPUT_EXPORTED => 2, # output exported symbols
298+ OUTPUT_INTERNAL => 3, # output non-exported symbols
292299 };
293300 my $output_selection = OUTPUT_ALL;
294301 my $show_not_found = 0; # No longer used
@@ -313,6 +320,7 @@ my $man_date = ('January', 'February', 'March', 'April', 'May', 'June', · 18 unmodified lines
313320 # CAVEAT EMPTOR! Some of the others I localised may not want to be, which
314321 # could cause "use of undefined value" or other bugs.
315322 my ($function, %function_table, %parametertypes, $declaration_purpose);
323+my %nosymbol_table = ();
316324 my $declaration_start_line;
317325 my ($type, $declaration_name, $return_type);
318326 my ($newsection, $newcontents, $prototype, $brcount, %source_map);
@@ -432,10 +440,9 @@ while ($ARGV[0] =~ m/^--?(.*)/) { · 113 unmodified lines
432440 $output_selection = OUTPUT_INCLUDE;
433441 $function = shift @ARGV;
434442 $function_table{$function} = 1;
435− } elsif ($cmd eq "nofunction") { # output all except specific functions
436− $output_selection = OUTPUT_EXCLUDE;
437− $function = shift @ARGV;
438− $function_table{$function} = 1;
443+ } elsif ($cmd eq "nosymbol") { # Exclude specific symbols
444+ my $symbol = shift @ARGV;
445+ $nosymbol_table{$symbol} = 1;
439446 } elsif ($cmd eq "export") { # only exported symbols
440447 $output_selection = OUTPUT_EXPORTED;
441448 %function_table = ();
@@ -457,6 +464,23 @@ while ($ARGV[0] =~ m/^--?(.*)/) { · 15 unmodified lines
457464 $enable_lineno = 1;
458465 } elsif ($cmd eq 'show-not-found') {
459466 $show_not_found = 1; # A no-op but don't fail
467+ } elsif ($cmd eq "sphinx-version") {
468+ my $ver_string = shift @ARGV;
469+ if ($ver_string =~ m/^(\d+)(\.\d+)?(\.\d+)?/) {
470+ $sphinx_major = $1;
471+ if (defined($2)) {
472+ $sphinx_minor = substr($2,1);
473+ } else {
474+ $sphinx_minor = 0;
475+ }
476+ if (defined($3)) {
477+ $sphinx_patch = substr($3,1)
478+ } else {
479+ $sphinx_patch = 0;
480+ }
481+ } else {
482+ die "Sphinx version should either major.minor or major.minor.patch format\n";
483+ }
460484 } else {
461485 # Unknown argument
462486 usage();
@@ -465,6 +489,51 @@ while ($ARGV[0] =~ m/^--?(.*)/) { · 2 unmodified lines
465489
466490 # continue execution near EOF;
467491
492+# The C domain dialect changed on Sphinx 3. So, we need to check the
493+# version in order to produce the right tags.
494+sub findprog($)
495+{
496+ foreach(split(/:/, $ENV{PATH})) {
497+ return "$_/$_[0]" if(-x "$_/$_[0]");
498+ }
499+}
500+
501+sub get_sphinx_version()
502+{
503+ my $ver;
504+
505+ my $cmd = "sphinx-build";
506+ if (!findprog($cmd)) {
507+ my $cmd = "sphinx-build3";
508+ if (!findprog($cmd)) {
509+ $sphinx_major = 1;
510+ $sphinx_minor = 2;
511+ $sphinx_patch = 0;
512+ printf STDERR "Warning: Sphinx version not found. Using default (Sphinx version %d.%d.%d)\n",
513+ $sphinx_major, $sphinx_minor, $sphinx_patch;
514+ return;
515+ }
516+ }
517+
518+ open IN, "$cmd --version 2>&1 |";
519+ while (<IN>) {
520+ if (m/^\s*sphinx-build\s+([\d]+)\.([\d\.]+)(\+\/[\da-f]+)?$/) {
521+ $sphinx_major = $1;
522+ $sphinx_minor = $2;
523+ $sphinx_patch = $3;
524+ last;
525+ }
526+ # Sphinx 1.2.x uses a different format
527+ if (m/^\s*Sphinx.*\s+([\d]+)\.([\d\.]+)$/) {
528+ $sphinx_major = $1;
529+ $sphinx_minor = $2;
530+ $sphinx_patch = $3;
531+ last;
532+ }
533+ }
534+ close IN;
535+}
536+
468537 # get kernel version from env
469538 sub get_kernel_version() {
470539 my $version = 'unknown kernel version';
@@ -531,11 +600,11 @@ sub dump_doc_section { · 60 unmodified lines
531600 return;
532601 }
533602
603+ return if (defined($nosymbol_table{$name}));
604+
534605 if (($output_selection == OUTPUT_ALL) ||
535− ($output_selection == OUTPUT_INCLUDE &&
536− defined($function_table{$name})) ||
537− ($output_selection == OUTPUT_EXCLUDE &&
538− !defined($function_table{$name})))
606+ (($output_selection == OUTPUT_INCLUDE) &&
607+ defined($function_table{$name})))
539608 {
540609 dump_section($file, $name, $contents);
541610 output_blockhead({'sectionlist' => \@sectionlist,
@@ -618,10 +687,10 @@ sub output_function_man(%) { · 76 unmodified lines
618687 $type = $args{'parametertypes'}{$parameter};
619688 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
620689 # pointer-to-function
621− print ".BI \"" . $parenth . $1 . "\" " . $parameter . " \") (" . $2 . ")" . $post . "\"\n";
690+ print ".BI \"" . $parenth . $1 . "\" " . " \") (" . $2 . ")" . $post . "\"\n";
622691 } else {
623692 $type =~ s/([^\*])$/$1 /;
624− print ".BI \"" . $parenth . $type . "\" " . $parameter . " \"" . $post . "\"\n";
693+ print ".BI \"" . $parenth . $type . "\" " . " \"" . $post . "\"\n";
625694 }
626695 $count++;
627696 $parenth = "";
@@ -761,6 +830,8 @@ sub output_blockhead_rst(%) { · 133 unmodified lines
761830 my ($parameter, $section);
762831
763832 foreach $section (@{$args{'sectionlist'}}) {
833+ next if (defined($nosymbol_table{$section}));
834+
764835 if ($output_selection != OUTPUT_INCLUDE) {
765836 print "**$section**\n\n";
766837 }
@@ -846,16 +917,37 @@ sub output_function_rst(%) { · 79 unmodified lines
846917 my ($parameter, $section);
847918 my $oldprefix = $lineprefix;
848919 my $start = "";
849−
850− if ($args{'typedef'}) {
851− print ".. c:type:: ". $args{'function'} . "\n\n";
852− print_lineno($declaration_start_line);
853− print " **Typedef**: ";
854− $lineprefix = "";
855− output_highlight_rst($args{'purpose'});
856− $start = "\n\n**Syntax**\n\n ``";
920+ my $is_macro = 0;
921+
922+ if ($sphinx_major < 3) {
923+ if ($args{'typedef'}) {
924+ print ".. c:type:: ". $args{'function'} . "\n\n";
925+ print_lineno($declaration_start_line);
926+ print " **Typedef**: ";
927+ $lineprefix = "";
928+ output_highlight_rst($args{'purpose'});
929+ $start = "\n\n**Syntax**\n\n ``";
930+ $is_macro = 1;
931+ } else {
932+ print ".. c:function:: ";
933+ }
857934 } else {
858− print ".. c:function:: ";
935+ if ($args{'typedef'} || $args{'functiontype'} eq "") {
936+ $is_macro = 1;
937+ print ".. c:macro:: ". $args{'function'} . "\n\n";
938+ } else {
939+ print ".. c:function:: ";
940+ }
941+
942+ if ($args{'typedef'}) {
943+ print_lineno($declaration_start_line);
944+ print " **Typedef**: ";
945+ $lineprefix = "";
946+ output_highlight_rst($args{'purpose'});
947+ $start = "\n\n**Syntax**\n\n ``";
948+ } else {
949+ print "``" if ($is_macro);
950+ }
859951 }
860952 if ($args{'functiontype'} ne "") {
861953 $start .= $args{'functiontype'} . " " . $args{'function'} . " (";
@@ -876,13 +968,15 @@ sub output_function_rst(%) { · 14 unmodified lines
876968 # pointer-to-function
877969 print $1 . $parameter . ") (" . $2 . ")";
878970 } else {
879− print $type . " " . $parameter;
971+ print $type;
880972 }
881973 }
882− if ($args{'typedef'}) {
883− print ");``\n\n";
974+ if ($is_macro) {
975+ print ")``\n\n";
884976 } else {
885977 print ")\n\n";
978+ }
979+ if (!$args{'typedef'}) {
886980 print_lineno($declaration_start_line);
887981 $lineprefix = " ";
888982 output_highlight_rst($args{'purpose'});
@@ -897,7 +991,7 @@ sub output_function_rst(%) { · 8 unmodified lines
897991 $type = $args{'parametertypes'}{$parameter};
898992
899993 if ($type ne "") {
900− print "``$type $parameter``\n";
994+ print "``$type``\n";
901995 } else {
902996 print "``$parameter``\n";
903997 }
@@ -938,9 +1032,14 @@ sub output_enum_rst(%) { · 34 unmodified lines
9381032 my ($parameter);
9391033 my $oldprefix = $lineprefix;
9401034 my $count;
941− my $name = "enum " . $args{'enum'};
9421035
943− print "\n\n.. c:type:: " . $name . "\n\n";
1036+ if ($sphinx_major < 3) {
1037+ my $name = "enum " . $args{'enum'};
1038+ print "\n\n.. c:type:: " . $name . "\n\n";
1039+ } else {
1040+ my $name = $args{'enum'};
1041+ print "\n\n.. c:enum:: " . $name . "\n\n";
1042+ }
9441043 print_lineno($declaration_start_line);
9451044 $lineprefix = " ";
9461045 output_highlight_rst($args{'purpose'});
@@ -966,8 +1065,13 @@ sub output_typedef_rst(%) { · 19 unmodified lines
9661065 my %args = %{$_[0]};
9671066 my ($parameter);
9681067 my $oldprefix = $lineprefix;
969− my $name = "typedef " . $args{'typedef'};
1068+ my $name;
9701069
1070+ if ($sphinx_major < 3) {
1071+ $name = "typedef " . $args{'typedef'};
1072+ } else {
1073+ $name = $args{'typedef'};
1074+ }
9711075 print "\n\n.. c:type:: " . $name . "\n\n";
9721076 print_lineno($declaration_start_line);
9731077 $lineprefix = " ";
@@ -982,9 +1086,14 @@ sub output_struct_rst(%) { · 8 unmodified lines
9821086 my %args = %{$_[0]};
9831087 my ($parameter);
9841088 my $oldprefix = $lineprefix;
985− my $name = $args{'type'} . " " . $args{'struct'};
9861089
987− print "\n\n.. c:type:: " . $name . "\n\n";
1090+ if ($sphinx_major < 3) {
1091+ my $name = $args{'type'} . " " . $args{'struct'};
1092+ print "\n\n.. c:type:: " . $name . "\n\n";
1093+ } else {
1094+ my $name = $args{'struct'};
1095+ print "\n\n.. c:struct:: " . $name . "\n\n";
1096+ }
9881097 print_lineno($declaration_start_line);
9891098 $lineprefix = " ";
9901099 output_highlight_rst($args{'purpose'});
@@ -1043,12 +1152,14 @@ sub output_declaration { · 52 unmodified lines
10431152 my $name = shift;
10441153 my $functype = shift;
10451154 my $func = "output_${functype}_$output_mode";
1155+
1156+ return if (defined($nosymbol_table{$name}));
1157+
10461158 if (($output_selection == OUTPUT_ALL) ||
10471159 (($output_selection == OUTPUT_INCLUDE ||
10481160 $output_selection == OUTPUT_EXPORTED) &&
10491161 defined($function_table{$name})) ||
1050− (($output_selection == OUTPUT_EXCLUDE ||
1051− $output_selection == OUTPUT_INTERNAL) &&
1162+ ($output_selection == OUTPUT_INTERNAL &&
10521163 !($functype eq "function" && defined($function_table{$name}))))
10531164 {
10541165 &$func(@_);
@@ -1229,6 +1340,8 @@ sub show_warnings($$) { · 174 unmodified lines
12291340 my $functype = shift;
12301341 my $name = shift;
12311342
1343+ return 0 if (defined($nosymbol_table{$name}));
1344+
12321345 return 1 if ($output_selection == OUTPUT_ALL);
12331346
12341347 if ($output_selection == OUTPUT_EXPORTED) {
@@ -1252,27 +1365,28 @@ sub show_warnings($$) { · 17 unmodified lines
12521365 return 0;
12531366 }
12541367 }
1255− if ($output_selection == OUTPUT_EXCLUDE) {
1256− if (!defined($function_table{$name})) {
1257− return 1;
1258− } else {
1259− return 0;
1260− }
1261− }
12621368 die("Please add the new output type at show_warnings()");
12631369 }
12641370
12651371 sub dump_enum($$) {
12661372 my $x = shift;
12671373 my $file = shift;
1374+ my $members;
1375+
12681376
12691377 $x =~ s@/\*.*?\*/@@gos; # strip comments.
12701378 # strip #define macros inside enums
12711379 $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos;
12721380
1273− if ($x =~ /enum\s+(\w*)\s*\{(.*)\}/) {
1381+ if ($x =~ /typedef\s+enum\s*\{(.*)\}\s*(\w*)\s*;/) {
1382+ $declaration_name = $2;
1383+ $members = $1;
1384+ } elsif ($x =~ /enum\s+(\w*)\s*\{(.*)\}/) {
12741385 $declaration_name = $1;
1275− my $members = $2;
1386+ $members = $2;
1387+ }
1388+
1389+ if ($declaration_name) {
12761390 my %_members;
12771391
12781392 $members =~ s/\s+$//;
@@ -1307,8 +1421,7 @@ sub dump_enum($$) { · 28 unmodified lines
13071421 'sections' => \%sections,
13081422 'purpose' => $declaration_purpose
13091423 });
1310− }
1311− else {
1424+ } else {
13121425 print STDERR "${file}:$.: error: Cannot parse enum!\n";
13131426 ++$errors;
13141427 }
@@ -1403,7 +1516,7 @@ sub create_parameterlist($$$$) { · 88 unmodified lines
14031516 # Treat preprocessor directive as a typeless variable just to fill
14041517 # corresponding data structures "correctly". Catch it later in
14051518 # output_* subs.
1406− push_parameter($arg, "", $file);
1519+ push_parameter($arg, "", "", $file);
14071520 } elsif ($arg =~ m/\(.+\)\s*\(/) {
14081521 # pointer-to-function
14091522 $arg =~ tr/#/,/;
@@ -1412,7 +1525,7 @@ sub create_parameterlist($$$$) { · 2 unmodified lines
14121525 $type = $arg;
14131526 $type =~ s/([^\(]+\(\*?)\s*$param/$1/;
14141527 save_struct_actual($param);
1415− push_parameter($param, $type, $file, $declaration_name);
1528+ push_parameter($param, $type, $arg, $file, $declaration_name);
14161529 } elsif ($arg) {
14171530 $arg =~ s/\s*:\s*/:/g;
14181531 $arg =~ s/\s*\[/\[/g;
@@ -1437,26 +1550,28 @@ sub create_parameterlist($$$$) { · 18 unmodified lines
14371550 foreach $param (@args) {
14381551 if ($param =~ m/^(\*+)\s*(.*)/) {
14391552 save_struct_actual($2);
1440− push_parameter($2, "$type $1", $file, $declaration_name);
1553+
1554+ push_parameter($2, "$type $1", $arg, $file, $declaration_name);
14411555 }
14421556 elsif ($param =~ m/(.*?):(\d+)/) {
14431557 if ($type ne "") { # skip unnamed bit-fields
14441558 save_struct_actual($1);
1445− push_parameter($1, "$type:$2", $file, $declaration_name)
1559+ push_parameter($1, "$type:$2", $arg, $file, $declaration_name)
14461560 }
14471561 }
14481562 else {
14491563 save_struct_actual($param);
1450− push_parameter($param, $type, $file, $declaration_name);
1564+ push_parameter($param, $type, $arg, $file, $declaration_name);
14511565 }
14521566 }
14531567 }
14541568 }
14551569 }
14561570
1457−sub push_parameter($$$$) {
1571+sub push_parameter($$$$$) {
14581572 my $param = shift;
14591573 my $type = shift;
1574+ my $org_arg = shift;
14601575 my $file = shift;
14611576 my $declaration_name = shift;
14621577
@@ -1520,8 +1635,8 @@ sub push_parameter($$$$) { · 57 unmodified lines
15201635 # "[blah" in a parameter string;
15211636 ###$param =~ s/\s*//g;
15221637 push @parameterlist, $param;
1523− $type =~ s/\s\s+/ /g;
1524− $parametertypes{$param} = $type;
1638+ $org_arg =~ s/\s\s+/ /g;
1639+ $parametertypes{$param} = $org_arg;
15251640 }
15261641
15271642 sub check_sections($$$$$) {
@@ -1595,7 +1710,7 @@ sub dump_function($$) { · 67 unmodified lines
15951710 my $file = shift;
15961711 my $noret = 0;
15971712
1598− print_lineno($.);
1713+ print_lineno($new_start_line);
15991714
16001715 $prototype =~ s/^static +//;
16011716 $prototype =~ s/^extern +//;
@@ -1672,30 +1787,48 @@ sub dump_function($$) { · 70 unmodified lines
16721787 return;
16731788 }
16741789
1675− my $prms = join " ", @parameterlist;
1676− check_sections($file, $declaration_name, "function", $sectcheck, $prms);
1790+ my $prms = join " ", @parameterlist;
1791+ check_sections($file, $declaration_name, "function", $sectcheck, $prms);
16771792
1678− # This check emits a lot of warnings at the moment, because many
1679− # functions don't have a 'Return' doc section. So until the number
1680− # of warnings goes sufficiently down, the check is only performed in
1681− # verbose mode.
1682− # TODO: always perform the check.
1683− if ($verbose && !$noret) {
1684− check_return_section($file, $declaration_name, $return_type);
1685− }
1793+ # This check emits a lot of warnings at the moment, because many
1794+ # functions don't have a 'Return' doc section. So until the number
1795+ # of warnings goes sufficiently down, the check is only performed in
1796+ # verbose mode.
1797+ # TODO: always perform the check.
1798+ if ($verbose && !$noret) {
1799+ check_return_section($file, $declaration_name, $return_type);
1800+ }
16861801
1687− output_declaration($declaration_name,
1688− 'function',
1689− {'function' => $declaration_name,
1690− 'module' => $modulename,
1691− 'functiontype' => $return_type,
1692− 'parameterlist' => \@parameterlist,
1693− 'parameterdescs' => \%parameterdescs,
1694− 'parametertypes' => \%parametertypes,
1695− 'sectionlist' => \@sectionlist,
1696− 'sections' => \%sections,
1697− 'purpose' => $declaration_purpose
1698− });
1802+ # The function parser can be called with a typedef parameter.
1803+ # Handle it.
1804+ if ($return_type =~ /typedef/) {
1805+ output_declaration($declaration_name,
1806+ 'function',
1807+ {'function' => $declaration_name,
1808+ 'typedef' => 1,
1809+ 'module' => $modulename,
1810+ 'functiontype' => $return_type,
1811+ 'parameterlist' => \@parameterlist,
1812+ 'parameterdescs' => \%parameterdescs,
1813+ 'parametertypes' => \%parametertypes,
1814+ 'sectionlist' => \@sectionlist,
1815+ 'sections' => \%sections,
1816+ 'purpose' => $declaration_purpose
1817+ });
1818+ } else {
1819+ output_declaration($declaration_name,
1820+ 'function',
1821+ {'function' => $declaration_name,
1822+ 'module' => $modulename,
1823+ 'functiontype' => $return_type,
1824+ 'parameterlist' => \@parameterlist,
1825+ 'parameterdescs' => \%parameterdescs,
1826+ 'parametertypes' => \%parametertypes,
1827+ 'sectionlist' => \@sectionlist,
1828+ 'sections' => \%sections,
1829+ 'purpose' => $declaration_purpose
1830+ });
1831+ }
16991832 }
17001833
17011834 sub reset_state {
@@ -1873,6 +2006,7 @@ sub process_export_file($) { · 171 unmodified lines
18732006
18742007 while (<IN>) {
18752008 if (/$export_symbol/) {
2009+ next if (defined($nosymbol_table{$2}));
18762010 $function_table{$2} = 1;
18772011 }
18782012 }
@@ -1904,7 +2038,7 @@ sub process_name($$) { · 25 unmodified lines
19042038 if (/$doc_block/o) {
19052039 $state = STATE_DOCBLOCK;
19062040 $contents = "";
1907− $new_start_line = $. + 1;
2041+ $new_start_line = $.;
19082042
19092043 if ( $1 eq "" ) {
19102044 $section = $section_intro;
@@ -1987,6 +2121,7 @@ sub process_body($$) { · 76 unmodified lines
19872121 if ($state == STATE_BODY_WITH_BLANK_LINE && /^\s*\*\s?\S/) {
19882122 dump_section($file, $section, $contents);
19892123 $section = $section_default;
2124+ $new_start_line = $.;
19902125 $contents = "";
19912126 }
19922127
@@ -2042,6 +2177,7 @@ sub process_body($$) { · 49 unmodified lines
20422177 $prototype = "";
20432178 $state = STATE_PROTO;
20442179 $brcount = 0;
2180+ $new_start_line = $. + 1;
20452181 } elsif (/$doc_content/) {
20462182 if ($1 eq "") {
20472183 if ($section eq $section_context) {
@@ -2189,7 +2325,7 @@ sub process_file($) { · 141 unmodified lines
21892325
21902326 $file = map_filename($orig_file);
21912327
2192− if (!open(IN,"<$file")) {
2328+ if (!open(IN_FILE,"<$file")) {
21932329 print STDERR "Error: Cannot open file $file\n";
21942330 ++$errors;
21952331 return;
@@ -2198,9 +2334,9 @@ sub process_file($) { · 2 unmodified lines
21982334 $. = 1;
21992335
22002336 $section_counter = 0;
2201− while (<IN>) {
2337+ while (<IN_FILE>) {
22022338 while (s/\\\s*$//) {
2203− $_ .= <IN>;
2339+ $_ .= <IN_FILE>;
22042340 }
22052341 # Replace tabs by spaces
22062342 while ($_ =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {};
@@ -2232,9 +2368,14 @@ sub process_file($) { · 25 unmodified lines
22322368 print STDERR "${file}:1: warning: no structured comments found\n";
22332369 }
22342370 }
2371+ close IN_FILE;
22352372 }
22362373
22372374
2375+if ($output_mode eq "rst") {
2376+ get_sphinx_version() if (!$sphinx_major);
2377+}
2378+
22382379 $kernelversion = get_kernel_version();
22392380
22402381 # generate a sequence of code that will splice in highlighting information