diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 9a08fb5c1af640f1f65e5ae6a28cb8b95e6f0ad0..532d8cd2543f69343373c4be9749543f5ece446e 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1746,7 +1746,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++;