summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandy Dunlap <randy.dunlap@oracle.com>2006-12-22 01:10:50 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-22 08:55:50 -0800
commit134fe01bfafa74e691d84bf15666fb30e89896ff (patch)
treed64b10731a9030fd1304e5cab43ac6cf861f2a43
parent01b2d93ca4c495f056471189ac6c4e6ac4cbbccb (diff)
downloadlinux-3.10-134fe01bfafa74e691d84bf15666fb30e89896ff.tar.gz
linux-3.10-134fe01bfafa74e691d84bf15666fb30e89896ff.tar.bz2
linux-3.10-134fe01bfafa74e691d84bf15666fb30e89896ff.zip
[PATCH] kernel-doc: allow unnamed structs/unions
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> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rwxr-xr-xscripts/kernel-doc17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index df3b272f7ce..f50a70f550b 100755
--- a/scripts/kernel-doc
+++ b/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;