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

scripts/kernel-doc: Processing -nofunc for functions only

Docproc processes the EXPORT_SYMBOL(f1) macro and uses -nofunc f1 to
avoid duplicated documentation in the next call.
It works for most of the cases, but there are some specific situations
where a struct has the same name of an already-exported function.

Current kernel-doc behavior ignores those structs and does not add them
to the final documentation. This patch fixes it.

This is unusual, the only case I've found is the drm_modeset_lock
(function and struct) defined in drm_modeset_lock.h and
drm_modeset_lock.c. Considering this, it should only affect the DRM
documentation by including struct drm_modeset_lock to the final Docbook.

Signed-off-by: Danilo Cesar Lemes de Paula <danilo.cesar@collabora.co.uk>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Danilo Cesar Lemes de Paula and committed by
Jonathan Corbet
23aebb3c 47f16529

+1 -1
+1 -1
scripts/kernel-doc
··· 1746 1746 my $func = "output_${functype}_$output_mode"; 1747 1747 if (($function_only==0) || 1748 1748 ( $function_only == 1 && defined($function_table{$name})) || 1749 - ( $function_only == 2 && !defined($function_table{$name}))) 1749 + ( $function_only == 2 && !($functype eq "function" && defined($function_table{$name})))) 1750 1750 { 1751 1751 &$func(@_); 1752 1752 $section_counter++;