Skip to content

Commit be92641

Browse files
wensJonathan Corbet
authored andcommitted
scripts/kernel-doc: Do not track section counter across processed files
The section counter tracks how many sections of kernel-doc were added. The only real use of the counter value is to check if anything was actually supposed to be output and give a warning is nothing is available. The current logic of remembering the initial value and then resetting the value then when processing each file means that if a file has the same number of sections as the previously processed one, a warning is incorrectly given. Fixes: 1da177e ("Linux-2.6.12-rc2") Signed-off-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 6a32c8d commit be92641

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

scripts/kernel-doc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,7 +2322,6 @@ sub process_inline($$) {
23222322

23232323
sub process_file($) {
23242324
my $file;
2325-
my $initial_section_counter = $section_counter;
23262325
my ($orig_file) = @_;
23272326

23282327
$file = map_filename($orig_file);
@@ -2360,8 +2359,7 @@ sub process_file($) {
23602359
}
23612360

23622361
# Make sure we got something interesting.
2363-
if ($initial_section_counter == $section_counter && $
2364-
output_mode ne "none") {
2362+
if (!$section_counter && $output_mode ne "none") {
23652363
if ($output_selection == OUTPUT_INCLUDE) {
23662364
emit_warning("${file}:1", "'$_' not found\n")
23672365
for keys %function_table;

0 commit comments

Comments
 (0)