Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/174a15607fd057c736dc9123c53d0835ce20e68b.1740387599.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
19b100b0 b9609ecb

-11
-11
scripts/kernel-doc
··· 137 137 my $Werror = 0; 138 138 my $Wreturn = 0; 139 139 my $Wshort_desc = 0; 140 - my $Wcontents_before_sections = 0; 141 140 my $output_mode = "rst"; 142 141 my $output_preformatted = 0; 143 142 my $no_doc_sections = 0; ··· 222 223 STATE_INLINE => 7, # gathering doc outside main block 223 224 }; 224 225 my $state; 225 - my $in_doc_sect; 226 226 my $leading_space; 227 227 228 228 # Inline documentation state ··· 330 332 $Wreturn = 1; 331 333 } elsif ($cmd eq "Wshort-desc" or $cmd eq "Wshort-description") { 332 334 $Wshort_desc = 1; 333 - } elsif ($cmd eq "Wcontents-before-sections") { 334 - $Wcontents_before_sections = 1; 335 335 } elsif ($cmd eq "Wall") { 336 336 $Wreturn = 1; 337 337 $Wshort_desc = 1; 338 - $Wcontents_before_sections = 1; 339 338 } elsif (($cmd eq "h") || ($cmd eq "help")) { 340 339 pod2usage(-exitval => 0, -verbose => 2); 341 340 } elsif ($cmd eq 'no-doc-sections') { ··· 1958 1963 sub process_normal() { 1959 1964 if (/$doc_start/o) { 1960 1965 $state = STATE_NAME; # next line is always the function name 1961 - $in_doc_sect = 0; 1962 1966 $declaration_start_line = $. + 1; 1963 1967 } 1964 1968 } ··· 2062 2068 } 2063 2069 2064 2070 if (/$doc_sect/i) { # case insensitive for supported section names 2065 - $in_doc_sect = 1; 2066 2071 $newsection = $1; 2067 2072 $newcontents = $2; 2068 2073 ··· 2078 2085 } 2079 2086 2080 2087 if (($contents ne "") && ($contents ne "\n")) { 2081 - if (!$in_doc_sect && $Wcontents_before_sections) { 2082 - emit_warning("${file}:$.", "contents before sections\n"); 2083 - } 2084 2088 dump_section($file, $section, $contents); 2085 2089 $section = $section_default; 2086 2090 } 2087 2091 2088 - $in_doc_sect = 1; 2089 2092 $state = STATE_BODY; 2090 2093 $contents = $newcontents; 2091 2094 $new_start_line = $.;