scripts: kernel-doc: fix typedef identification
Some typedef expressions are output as normal functions. As we need to be clearer about the type with Sphinx 3.x, detect such cases. While here, fix a wrongly-indented block. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201117165312.118257-21-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
78c8c92c5d
commit
3999ffcf13
@ -1748,30 +1748,48 @@ sub dump_function($$) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $prms = join " ", @parameterlist;
|
my $prms = join " ", @parameterlist;
|
||||||
check_sections($file, $declaration_name, "function", $sectcheck, $prms);
|
check_sections($file, $declaration_name, "function", $sectcheck, $prms);
|
||||||
|
|
||||||
# This check emits a lot of warnings at the moment, because many
|
# This check emits a lot of warnings at the moment, because many
|
||||||
# functions don't have a 'Return' doc section. So until the number
|
# functions don't have a 'Return' doc section. So until the number
|
||||||
# of warnings goes sufficiently down, the check is only performed in
|
# of warnings goes sufficiently down, the check is only performed in
|
||||||
# verbose mode.
|
# verbose mode.
|
||||||
# TODO: always perform the check.
|
# TODO: always perform the check.
|
||||||
if ($verbose && !$noret) {
|
if ($verbose && !$noret) {
|
||||||
check_return_section($file, $declaration_name, $return_type);
|
check_return_section($file, $declaration_name, $return_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
output_declaration($declaration_name,
|
# The function parser can be called with a typedef parameter.
|
||||||
'function',
|
# Handle it.
|
||||||
{'function' => $declaration_name,
|
if ($return_type =~ /typedef/) {
|
||||||
'module' => $modulename,
|
output_declaration($declaration_name,
|
||||||
'functiontype' => $return_type,
|
'function',
|
||||||
'parameterlist' => \@parameterlist,
|
{'function' => $declaration_name,
|
||||||
'parameterdescs' => \%parameterdescs,
|
'typedef' => 1,
|
||||||
'parametertypes' => \%parametertypes,
|
'module' => $modulename,
|
||||||
'sectionlist' => \@sectionlist,
|
'functiontype' => $return_type,
|
||||||
'sections' => \%sections,
|
'parameterlist' => \@parameterlist,
|
||||||
'purpose' => $declaration_purpose
|
'parameterdescs' => \%parameterdescs,
|
||||||
});
|
'parametertypes' => \%parametertypes,
|
||||||
|
'sectionlist' => \@sectionlist,
|
||||||
|
'sections' => \%sections,
|
||||||
|
'purpose' => $declaration_purpose
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
output_declaration($declaration_name,
|
||||||
|
'function',
|
||||||
|
{'function' => $declaration_name,
|
||||||
|
'module' => $modulename,
|
||||||
|
'functiontype' => $return_type,
|
||||||
|
'parameterlist' => \@parameterlist,
|
||||||
|
'parameterdescs' => \%parameterdescs,
|
||||||
|
'parametertypes' => \%parametertypes,
|
||||||
|
'sectionlist' => \@sectionlist,
|
||||||
|
'sections' => \%sections,
|
||||||
|
'purpose' => $declaration_purpose
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub reset_state {
|
sub reset_state {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user