Skip to contentSkip to conversation

kernel-doc: allow unnamed structs/unions

PATCH New Randy Dunlap 2 participants 2 messages Dec 20, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-doc: allow unnamed structs/unions

From: Randy Dunlap <[email protected]>

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.

---
 scripts/kernel-doc |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
scripts/kernel-doc +15 -2
@@ -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;

---

#1 lore raw

PATCH 1/1 kernel-doc: remove myself from MAINTAINERS

I don't have the time to work on Linux Documentation, so I really should document that in MAINTAINERS. With Randy, kernel-doc is in good hands anyway.

---

MAINTAINERS +0 -3
index 3e926e7..ba586b4 100644
@@ -943,11 +943,8 @@ L:	[email protected]
 S:	Maintained
 
 DOCBOOK FOR DOCUMENTATION
-P:	Martin Waitz
-M:	[email protected]
 P:	Randy Dunlap
 M:	[email protected]
-T:	git http://tali.admingilde.org/git/linux-docbook.git
 S:	Maintained
 
 DOCKING STATION DRIVER
Signature · 1 line
Martin Waitz