Skip to contentSkip to conversation

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

PATCH In review Danilo Cesar Lemes de Paula 2 participants 2 messages Sep 1, 2015 – Sep 11, 2015

lore
Share & tools
lore
#0 lore raw

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

Docproc process 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 do not add them to the final documentation. This patch fixes it.

This is non-usual and 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.

Cc Daniel Vetter <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Johannes Berg <[email protected]>
Cc intel-gfx <[email protected]>
Cc dri-devel <[email protected]>
---
 scripts/kernel-doc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kernel-doc +1 -1
index 12a106c..047deb7 100755
@@ -1827,7 +1827,7 @@ sub output_declaration {
     my $func = "output_${functype}_$output_mode";
     if (($function_only==0) ||
 	( $function_only == 1 && defined($function_table{$name})) ||
-	( $function_only == 2 && !defined($function_table{$name})))
+	( $function_only == 2 && !($functype eq "function" && defined($function_table{$name}))))
     {
 	&$func(@_);
 	$section_counter++;
Signature · 1 line
2.4.3
#1 lore raw
Quoted 5 lines · On Tue, 1 Sep 2015 14:44:14 -0300 Danilo Cesar Lemes de Paula…

Docproc process 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.

Quoted 7 lines

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

This is non-usual and 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.

I've verified that it indeed affects nothing else; it's in the docs tree now, thanks.

jon