aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRandy Dunlap <randy.dunlap@oracle.com>2006-12-22 04:10:50 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-22 11:55:50 -0500
commit134fe01bfafa74e691d84bf15666fb30e89896ff (patch)
treed64b10731a9030fd1304e5cab43ac6cf861f2a43 /scripts
parent01b2d93ca4c495f056471189ac6c4e6ac4cbbccb (diff)
[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>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/kernel-doc17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index df3b272f7ce6..f50a70f550b3 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1469,6 +1469,7 @@ sub push_parameter($$$) {
1469 my $param = shift; 1469 my $param = shift;
1470 my $type = shift; 1470 my $type = shift;
1471 my $file = shift; 1471 my $file = shift;
1472 my $anon = 0;
1472 1473
1473 my $param_name = $param; 1474 my $param_name = $param;
1474 $param_name =~ s/\[.*//; 1475 $param_name =~ s/\[.*//;
@@ -1484,9 +1485,20 @@ sub push_parameter($$$) {
1484 $param="void"; 1485 $param="void";
1485 $parameterdescs{void} = "no arguments"; 1486 $parameterdescs{void} = "no arguments";
1486 } 1487 }
1488 elsif ($type eq "" && ($param eq "struct" or $param eq "union"))
1489 # handle unnamed (anonymous) union or struct:
1490 {
1491 $type = $param;
1492 $param = "{unnamed_" . $param. "}";
1493 $parameterdescs{$param} = "anonymous\n";
1494 $anon = 1;
1495 }
1496
1487 # warn if parameter has no description 1497 # warn if parameter has no description
1488 # (but ignore ones starting with # as these are no parameters 1498 # (but ignore ones starting with # as these are not parameters
1489 # but inline preprocessor statements 1499 # but inline preprocessor statements);
1500 # also ignore unnamed structs/unions;
1501 if (!$anon) {
1490 if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) { 1502 if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) {
1491 1503
1492 $parameterdescs{$param_name} = $undescribed; 1504 $parameterdescs{$param_name} = $undescribed;
@@ -1500,6 +1512,7 @@ sub push_parameter($$$) {
1500 " No description found for parameter '$param'\n"; 1512 " No description found for parameter '$param'\n";
1501 ++$warnings; 1513 ++$warnings;
1502 } 1514 }
1515 }
1503 1516
1504 push @parameterlist, $param; 1517 push @parameterlist, $param;
1505 $parametertypes{$param} = $type; 1518 $parametertypes{$param} = $type;