All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel-doc: allow unnamed structs/unions
@ 2006-12-20  7:10 Randy Dunlap
  2006-12-20 10:39 ` [PATCH] kernel-doc: remove myself from MAINTAINERS Martin Waitz
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2006-12-20  7:10 UTC (permalink / raw)
  To: lkml; +Cc: akpm, tali, davem

From: Randy Dunlap <randy.dunlap@oracle.com>

Make kernel-doc support unnamed (anonymous) structs and unions.
There is one (union) in include/linux/skbuff.h (inside struct sk_buff)
that is currently generating a kernel-doc warning, so this
fixes that warning.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 scripts/kernel-doc |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

--- linux-2.6.20-rc1-git7.orig/scripts/kernel-doc
+++ linux-2.6.20-rc1-git7/scripts/kernel-doc
@@ -1469,6 +1469,7 @@ sub push_parameter($$$) {
 	my $param = shift;
 	my $type = shift;
 	my $file = shift;
+	my $anon = 0;
 
 	my $param_name = $param;
 	$param_name =~ s/\[.*//;
@@ -1484,9 +1485,20 @@ sub push_parameter($$$) {
 	    $param="void";
 	    $parameterdescs{void} = "no arguments";
 	}
+	elsif ($type eq "" && ($param eq "struct" or $param eq "union"))
+	# handle unnamed (anonymous) union or struct:
+	{
+		$type = $param;
+		$param = "{unnamed_" . $param. "}";
+		$parameterdescs{$param} = "anonymous\n";
+		$anon = 1;
+	}
+
 	# warn if parameter has no description
-	# (but ignore ones starting with # as these are no parameters
-	# but inline preprocessor statements
+	# (but ignore ones starting with # as these are not parameters
+	# but inline preprocessor statements);
+	# also ignore unnamed structs/unions;
+	if (!$anon) {
 	if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) {
 
 	    $parameterdescs{$param_name} = $undescribed;
@@ -1500,6 +1512,7 @@ sub push_parameter($$$) {
 	                 " No description found for parameter '$param'\n";
 	    ++$warnings;
         }
+        }
 
 	push @parameterlist, $param;
 	$parametertypes{$param} = $type;


---

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-20 11:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-20  7:10 [PATCH] kernel-doc: allow unnamed structs/unions Randy Dunlap
2006-12-20 10:39 ` [PATCH] kernel-doc: remove myself from MAINTAINERS Martin Waitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.