Skip to content

Commit 19b100b

Browse files
mchehabJonathan Corbet
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/174a15607fd057c736dc9123c53d0835ce20e68b.1740387599.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet <[email protected]>
1 parent b9609ec commit 19b100b

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

scripts/kernel-doc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ my $verbose = 0;
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 {
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/^--?(.*)/) {
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($) {
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($$) {
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($$) {
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 = $.;

0 commit comments

Comments
 (0)