[PATCH 6/6] scripts/kernel-doc: Processing -nofunc for functions only

Danilo Cesar Lemes de Paula danilo.cesar at collabora.co.uk
Mon Sep 7 13:02:04 PDT 2015


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.

Signed-off-by: Danilo Cesar Lemes de Paula <danilo.cesar at collabora.co.uk>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Jonathan Corbet <corbet at lwn.net>
Cc: Andrew Morton <akpm at linux-foundation.org>
Cc: Johannes Berg <johannes.berg at intel.com>
Cc: linux-kernel at vger.kernel.org
Cc: linux-doc at vger.kernel.org
Cc: intel-gfx <intel-gfx at lists.freedesktop.org>
Cc: dri-devel <dri-devel at lists.freedesktop.org>
---
 scripts/kernel-doc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index d6129e7..a01b20ea 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1836,7 +1836,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++;
-- 
2.4.3



More information about the dri-devel mailing list