History

scripts/kernel-doc: drop dead code for Wcontents_before_sections

There is a warning about contents before sections, which doesn't work, since in_doc_sect variable is always true at the point it is checked. Drop the dead code.

Mauro Carvalho Chehab committed 1 year ago

Commit 19b100b1 parent b9609ec1 file · +0 −11Browse files

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

Unified · Split

scripts/kernel-doc+0−11
@@ -137,7 +137,6 @@ my $verbose = 0; · 136 unmodified lines
137137 my $Werror = 0;
138138 my $Wreturn = 0;
139139 my $Wshort_desc = 0;
140−my $Wcontents_before_sections = 0;
141140 my $output_mode = "rst";
142141 my $output_preformatted = 0;
143142 my $no_doc_sections = 0;
@@ -223,7 +222,6 @@ use constant { · 79 unmodified lines
223222 STATE_INLINE => 7, # gathering doc outside main block
224223 };
225224 my $state;
226−my $in_doc_sect;
227225 my $leading_space;
228226
229227 # Inline documentation state
@@ -332,12 +330,9 @@ while ($ARGV[0] =~ m/^--?(.*)/) { · 102 unmodified lines
332330 $Wreturn = 1;
333331 } elsif ($cmd eq "Wshort-desc" or $cmd eq "Wshort-description") {
334332 $Wshort_desc = 1;
335− } elsif ($cmd eq "Wcontents-before-sections") {
336− $Wcontents_before_sections = 1;
337333 } elsif ($cmd eq "Wall") {
338334 $Wreturn = 1;
339335 $Wshort_desc = 1;
340− $Wcontents_before_sections = 1;
341336 } elsif (($cmd eq "h") || ($cmd eq "help")) {
342337 pod2usage(-exitval => 0, -verbose => 2);
343338 } elsif ($cmd eq 'no-doc-sections') {
@@ -1963,7 +1958,6 @@ sub process_export_file($) { · 1619 unmodified lines
19631958 sub process_normal() {
19641959 if (/$doc_start/o) {
19651960 $state = STATE_NAME; # next line is always the function name
1966− $in_doc_sect = 0;
19671961 $declaration_start_line = $. + 1;
19681962 }
19691963 }
@@ -2068,7 +2062,6 @@ sub process_body($$) { · 98 unmodified lines
20682062 }
20692063
20702064 if (/$doc_sect/i) { # case insensitive for supported section names
2071− $in_doc_sect = 1;
20722065 $newsection = $1;
20732066 $newcontents = $2;
20742067
@@ -2085,14 +2078,10 @@ sub process_body($$) { · 10 unmodified lines
20852078 }
20862079
20872080 if (($contents ne "") && ($contents ne "\n")) {
2088− if (!$in_doc_sect && $Wcontents_before_sections) {
2089− emit_warning("${file}:$.", "contents before sections\n");
2090− }
20912081 dump_section($file, $section, $contents);
20922082 $section = $section_default;
20932083 }
20942084
2095− $in_doc_sect = 1;
20962085 $state = STATE_BODY;
20972086 $contents = $newcontents;
20982087 $new_start_line = $.;